SSH - Aktivierung

Tja - wer hätte das gedacht - hier geht es darum, wie man den SSH-Deamon auf 'la fonera' aktiviert. Die Möglichkeiten die sich nach der Aktivierung von SSH bieten sind genau die - die man sich so ausdenkt. Könnt Ihr euch noch an den Film erinnern - wo 2 Typen zu Hause sitzen, mit dem Computer rumspielen und sich ne Frau basteln? (Anmerkung von noragen: Der Film hieß "Weird Science". Interesse? ;-P) Nunja - das kann 'la fonera' leider nicht. Grund: die Jungs von Fon haben hier ne olle 90 MHz CPU einbauen lassen - toller Trick - also nixs mit Seti!


Inhaltsverzeichnis

Firmware checken

also kurz und knapp:

was bisher geschah:

A.) Ihr habt euch mittels WPA mit der "MyPlace-SSID" des Routers verbunden.

B.) Ihr habt vom Router eine IP-Adresse bekommen



was Ihr jetzt macht:

1.) einloggen auf 192.168.X.1 (das X durch euer Subnetz ersetzen) - dort wird die aktuelle Version eurer Firmware veröffentlicht

Bild:La_fonera_firmware_im_webinterface.png

passendes Injection-Skript zur ssh-Aktivierung

von http://stefans.datenbruch.de/lafonera/ ziehen

la fonera - Firmwareversion Kurzbezeichnung DownloadLink - Skript
0.7.0-4 grammofon http://stefans.datenbruch.de/lafonera/scripts/grammofon.pl
0.7.1-1 fondue http://stefans.datenbruch.de/lafonera/scripts/fondue.pl
>0.7.1-1 noch nicht bekannt - fehlt -


In meinem Fall ist die 0.7.1-1 also die fondue-Version relevant.

Anmerkung:

leider hat "la fonera" die unangenehme Angewohnheit sich bei der Aktivierung (ob man die nun für wichtig hält oder nicht sei dahin gestellt) die aktuellste Version der Fon-Firmware aus dem Internet zu laden und zu installieren. Ein einfacher Tipp um dennoch eines der Skripte für den passiven Hack zu verwenden: "la fonera" einfach resetten!

Injetion-Skript ausführen

In der Annahme das sich ein - für eure Firmwareversion passendes - Injection Skript auf eurem Rechner befindet, geht es jetzt um die Auführung dieses Skriptes.


la fonera - Firmwareversion Kurzbezeichnung Skript-Ausführsyntax
0.7.0-4 grammofon echo -n '/usr/sbin/iptables -I INPUT 1 -p tcp --dport 22 -j ACCEPT' | perl grammofon.pl 192.168.10.1 admin

Anmerkung: ^^^^ das ist alles eine Zeile!

echo -n '/etc/init.d/dropbear' | perl grammofon.pl 192.168.10.1 admin
0.7.1-1 fondue echo -e '/usr/sbin/iptables -I INPUT 1 -p tcp --dport 22 -j ACCEPT\n/etc/init.d/dropbear' | perl fondue.pl 192.168.10.1 password
>0.7.1-1 noch nicht bekannt - fehlt -


Betracht man die Aufrufsyntax so wird ersichtlich, das erst die Firewall von "la fonera" auf Port 22 geöffnet wird und dann der dropbear - Deamon (ist der SSH Server den "la fonera" verwendet) gestartet wird.
hier der Mitschnitt meiner Session:

1.) Test mittels telnet auf Port 22 ob da ihgrendwas zuckt:

debian:~# telnet 192.168.10.1 22
Trying 192.168.10.1...
telnet: Unable to connect to remote host: Connection refused


hmmmm ... sieht nicht so aus - aber ich probier nochmal ssh ...

2.) Test mittels ssh ob ich ihrgendwie connecten kann ...

debian:~# ssh root@192.168.10.1
ssh: connect to host 192.168.10.1 port 22: Connection refused


hmmmm ... auch keine Reaktion. Okay, probier ich mal das für meine Firmware passende Skript.

3.) skript ausführen

debian:~# echo -e '/usr/sbin/iptables -I INPUT 1 -p tcp --dport 22 -j ACCEPT\n/etc/init.d/dropbear' | perl fondue.pl 192.168.10.1 admin
By your command...
Injecting command /usr/sbin/iptables -I INPUT 1 -p tcp --dport 22 -j ACCEPT...
Injecting command /etc/init.d/dropbear...
Code has been injected.


hmmm ... keine Fehlermeldungen - Okay, probier ich nochmal ein telnet auf Port 22

4.) Test mittels telnet auf Port 22 ob da ihgrendwas zuckt:

debian:~# telnet 192.168.10.1 22
Trying 192.168.10.1...
Connected to 192.168.10.1.
Escape character is '^]'.
SSH-2.0-dropbear_0.48


cool ... scheint tatsächlich zu funktionieren!

mittels ssh auf 'la fonera' einloggen

jetzt probier ich doch gleich mal eine Verbindung mittels ssh aufzubauen.
(Anmerkung: das root - Password ist übrigens admin)

debian:~# ssh root@192.168.10.1
The authenticity of host '192.168.10.1 (192.168.10.1)' can't be established.
RSA key fingerprint is **:1d:ee:fd:**:e8:0b:**:93:1e:**:30:8c:**:0c:**.
Are you sure you want to continue connecting (yes/no)?

yes ... eintippeln

Warning: Permanently added '192.168.10.1' (RSA) to the list of known hosts.
root@192.168.10.1's password:

admin ... eintippeln


BusyBox v1.1.3 (2006.11.21-19:49+0000) Built-in shell (ash)
Enter 'help' for a list of built-in commands.

 _______  _______  _______
|     ____||            | |    _    |
|     ____||      -     ||    ||    |
|     |       |_______||__| |__|
|___|

 Fonera Firmware (Version 0.7.1 rev 1) -------------
  *
  * Based on OpenWrt - http://openwrt.org
  * Powered by FON - http://www.fon.com
 ---------------------------------------------------
root@OpenWrt:~#                  


cool ... geht tatsächlich ohne aufschrauben!

ssh-Deamon in die INIT-Tabelle für dauerhaften Start eintragen

kurzer Abriss: la fonera bootet von einem Flash.
Unsere Code-Injection bezieht sich aber auf das laufende System.
Wird "la fonera" vom Stromnetz getrennt, ist unsere tolle Code-Injection leider im Status:

Nie Existent gewesen!!

eine einfache Abhilfe schafft hier folgendes:

root@OpenWrt:~# cd /etc/init.d/

ein kleiner Blick in das Verzeichniss:

root@OpenWrt:/etc/init.d# ls -l
-rwxr-xr-x    1 root     root          113 Nov 21  2006 N10conncheck
-rwxr-xr-x    1 root     root           90 Nov 21  2006 N40thinclient
-rwxr-xr-x    1 root     root          787 Nov 21  2006 N45ntpclient
-rwxr-xr-x    1 root     root         3636 Nov 21  2006 N50chillispot
-rwxr-xr-x    1 root     root           29 Nov 22  2006 S20madwifi
-rwxr-xr-x    1 root     root          160 Nov 21  2006 S40network
-rwxr-xr-x    1 root     root         3188 Nov 21  2006 S45firewall
-rwxr-xr-x    1 root     root           90 Nov 21  2006 S50httpd
-rwxr-xr-x    1 root     root           40 Nov 21  2006 S50qos
-rwxr-xr-x    1 root     root          145 Nov 21  2006 S50telnet
-rwxr-xr-x    1 root     root          137 Nov 21  2006 S60cron
-rwxr-xr-x    1 root     root          588 Jan  1 00:23 S60redirect
-rwxr-xr-x    1 root     root           77 Nov 21  2006 S65watchdog
-rwxr-xr-x    1 root     root          644 Nov 21  2006 boot
-rwxr-xr-x    1 root     root          333 Nov 21  2006 dropbear
-rwxr-xr-x    1 root     root          829 Nov 21  2006 rcS

für uns Interessant ist der dropbear- Deamon- (zu erkennen an:
-rwxr-xr-x 1 root root 333 Nov 21 2006 dropbear)!
Dieser sorgt dafür das auf "la fonera" DER ssh-Server gestartet wird.

unter: http://jauzsi.hu/2006/10/13/inside-of-the-fonera fand ich eine einfache Anleitung
(ohhh ... referenzierbare Quellen - danke - danke -danke !!!).

root@OpenWrt:/etc/init.d# mv /etc/init.d/dropbear /etc/init.d/S50dropbear


kurze Erklärung: jetzt wird der Dropbear-Deamon automatisch beim booten gestartet!

Von "https://www.lug-wr.de:443/wiki/index.php/SSH_-_Aktivierung"

Diese Seite wurde bisher 5616 mal abgerufen. Diese Seite wurde zuletzt geändert um 20:19, 6. Mär 2007. Inhalt ist verfügbar unter der GNU Free Documentation License 1.2.