A me interessa tantissimo, grazie
Ciao Max, grazie.
Ok. Tutto questo e' fatto da linux.
Spengiamo VS, tolgiamo il cavo di ADSL e riaccendiamo
Intanto, avviamo stunnel e wireshark
$ cat acs.stun
pid = /tmp/stunnel.pid
client = yes
fips=no
[acs4]
accept = 0.0.0.0:7004
connect = acs.dsl.vodafone.it:7004
[acs6]
accept = 0.0.0.0:7006
connect = acs.dsl.vodafone.it:7006
$ stunnel acs.stun
$ su
# wireshark -ki wlan0 -f 'port 7004 or port 7006'
Sarrebbe piu' chiaro se mettiamo (tcp.flags == 0x02) && (ip.src == 192.168.1.1) per filter
Colleghiamo al VS.
$ ./etel.pl (http://www.sbrk.co.uk/etel.pl)
SC O9uc01av81xXbQyXz4965oX3YqG9B5lw
Fetching http://192.168.1.1/mt@$%rE!s5&yuSh.cgi?wc512=O9uc01av81xXbQyXz4965oX3YqG9B5lw
killing 16881
$ telnet 192.168.1.1
Trying 192.168.1.1...
Connected to 192.168.1.1.
Escape character is '^]'.
Huawei Home Gateway
Login: admin
Password:
> dumpcfg
(Qui ho gia cambiato acsURL da https:// a http://)
(Per fare questo, devi salvare l'output di dumpcfg, da <psitree> a </psitree>, cambiare https->http e
reinstallare con http://www.sbrk.co.uk/upfw, tipo
./upfw config.xml
)
<psitree>
...
<tr69c state="enable" upgradesManaged="0" upgradeAvailable="0" informEnbl="1" informTime="0" informInterval="86400" acsURL="http://acs.dsl.vodafone.it:7004/cwmpWeb/CPEMgt" acsUser="002489-EchoLife-311111X11111111" acsPwd="xxx=" parameterKey="12345" connReqURL="http://188.217.55.55:8081/aaaaaaaaaaaaaa" connReqUser="002489-EchoLife-311111X11111111" connReqPwd="xxx=" kickURL="http://www.huawei.com/acs" provisioningCode="12345" />
...
</psitree>
> sh
# iptables -t nat -vL
...
Chain PREROUTING_IN (1 references)
0 0 DROP all -- br0 any anywhere 91.80.32.21
(acs.dsl.vodafone.it)
0 0 DROP all -- br0 any anywhere 91.80.33.21
(acs1.dsl.vodafone.it)
(vuol dire nessuno sul LAN puo collegare al server ACS)
(cancelliamo tutto)
# iptables -t nat -F
# iptables -t mangle -F
# iptables -F
(mandiamo traffico ACS verso un sistema interno con stunnel)
# iptables -t nat -I OUTPUT -p tcp --dport 7004 -j DNAT --to-destination 192.168.1.2
# iptables -t nat -I OUTPUT -p tcp --dport 7006 -j DNAT --to-destination 192.168.1.2
(questi sono stati cancellati con -F)
# iptables -t nat -I POSTROUTING -o nas_10_36 -j MASQUERADE
# iptables -t nat -I POSTROUTING -o nas_10_35 -j MASQUERADE
(ricolleghiamo il cavo adsl)
# exit
> logout
Dopo un breve periodo, vediamo su wireshark, due or tre sessioni
Scegliamo uno, facciamo right-click, follow TCP stream e vediamo
POST /cwmpWeb/CPEMgt HTTP/1.1
Host: acs.dsl.vodafone.it:7004
...
<EventCode>1 BOOT</EventCode>
...
<Name>InternetGatewayDevice.ManagementServer.ConnectionRequestURL</Name>
<Value xsi:type="xsd:string">http://188.217.55.55:8081/aaaaaaaaaaa</Value>
...
Questo URL serve per il ACS di collegare al VS e chiedere il VS di
ricollegare al VS (un tipo di ping). Quando succede il VS recollega
e vediamo:
<EventCode>6 CONNECTION REQUEST</EventCode>
Qui il ACS puo cambiare quello che vuole, tipo
<cwmp:SetParameterValues>
<ParameterValueStruct>
<Name>InternetGatewayDevice.ManagementServer.PeriodicInformInterval</Name>
<Value xsi:type="xsd:unsigned Int">1200</Value>
</ParameterValueStruct>
Quando vodafone vogliano cambiare firmware, penso che ci sara' un <cwmp:Download>
pero' puo anche funzionare su multicast. Non so quale metodo usano.
Se volete vedere tutto che puo' essere letto/scritto, ho installato un server ACS e ho visto tutti i settagi.
Si puo vedere qui:
http://www.sbrk.co.uk/vscfgBuon divertimento.