it:linux:gopro

Dies ist eine alte Version des Dokuments!


GoPro Linux

Ziel ist es eine Shell (per Telnet) zu erhalten.

  1. H4 Firmware Patcher herunterladen
  2. auf SD Karte speichern
  3. .jar ausfuehren:
    java -jar *.jar
  4. Jetzt liegt auf der SD-Karte ein Verzeichniss „UPDATE“ und eine update.zip, welche beim Einlegen der Karte in die Kamera installiert werden.
  5. Nach dem Update fuehr die Kamera Busybox-Shell-Kommandos aus der Datei „override.sh“ aus.
  6. override.sh:
    #!/bin/sh
    #Copy busybox as telnetd to /tmp
    cp /tmp/fuse_d/busybox /tmp/telnetd
    #make it executable
    chmod 777 /tmp/telnetd
    #start telnet
    /tmp/telnetd
    #There is a firewall (which is nice), so we have to open the right port
    iptables -D INPUT -j DROP
    iptables -A INPUT -p tcp -m tcp --dport 23 -j ACCEPT
    iptables -A INPUT -j DROP
     
    exit 0
  7. busybox.zip noch entpacken und auf die SD-Karte legen
  8. Kamera ausschalten und Akku entnehmen
  9. SD-Karte einstecken
  10. Akku entstecken
  11. Kamera anschalten
  12. Per Wlan mit Kamera verbinden (AD-hoc!)
  13. telnet 10.5.5.9

    User: root

  14. Fertig.

Anstatt telnet kann man auch ssh verwenden. Hierzu einfach anstatt der busybox die dropbear.zip auf der SD-Karte entpacken und folgende override.sh verwenden:

#!/bin/sh
 
#Copy dropbear to /tmp
cp /tmp/fuse_d/dropbear /tmp/dropbear
#make it executable
chmod 777 /tmp/dropbear
#start dropbear and allow logins without passwords
/tmp/dropbear -B
#There is a firewall (which is nice), so we have to open the right port
iptables -D INPUT -j DROP
iptables -A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
iptables -A INPUT -j DROP
 
exit 0

Wie sieht der Aufruf der override.sh genau aus?

Der Hook ist im init-System versteckt und zwar in /etc/init.d/S99wobmat und sieht folgendermassen aus:

#!/bin/sh
 
if [ -f /tmp/fuse_d/update/hd4_update.txt ]
then
  exit
fi
 
if [ -f /tmp/fuse_d/safemode.txt ]
then
  exit
fi
 
if [ -f /tmp/fuse_d/override.sh ]
then
  /bin/sh /tmp/fuse_d/override.sh
 
  if [ $? -eq 1 ] 
  then
    echo "Override script demands shutdown"
    exit
  fi  
fi
 
if [ -f /tmp/fuse_b/override.sh ]
then
  /bin/sh /tmp/fuse_b/override.sh
 
  if [ $? -eq 1 ] 
  then
    echo "Override script demands shutdown"
    exit
  fi  
fi
 
echo "Hello"
sh /root/srtda.sh
unzip UPDATE.zip
git clone https://github.com/evilwombat/ubi_reader.git
git clone https://github.com/evilwombat/gopro-fw-tools.git
cd gopro-fw-tools
make
cd ..
gopro-fw-tools/fwunpacker camera_firmware.bin
ubi_reader/extract_images.py section_4
mv ubi_reader/output/section_4 section_4_img
ubi_reader/extract_files.py section_4_img/img*linux.ubifs
mv ubi_reader/output/img-* .

Der Inhalt des Dateisystems befindet sich im Verzeichniss „img-*“.

Links

  • it/linux/gopro.1452109675.txt.gz
  • Zuletzt geändert: 2016/01/06 19:47
  • von admin