Freitag, 5. Juni 2009

systempasswort

linux: chroot /mountpoint/des/systems/mit/vergessenempassort/ /bash/bin
win: http://home.eunet.no/~pnordahl/ntpasswd/

Dienstag, 10. Februar 2009

(non-router) Port-Forward

A: stone (relativ langsam, aber userspace prog)
B: iptables:

#!/bin/bash
YourIP=1.2.3.4
YourPort=9999
TargetIP=2.3.4.5
TargetPort=8888
IPT="/sbin/iptables"

$IPT -t nat -A PREROUTING --dst $YourIP -p tcp --dport $YourPort -j DNAT
--to-destination $TargetIP:$TargetPort
$IPT -t nat -A POSTROUTING -p tcp --dst $TargetIP --dport $TargetPort -j
SNAT --to-source $YourIP
#$IPT -t nat -A OUTPUT --dst $YourIP -p tcp --dport $YourPort -j DNAT
--to-destination $TargetIP:$TargetPort

Freitag, 30. Januar 2009

(no subject)

Partitionstabelle sichern/einspielen:
sfdisk -d /dev/sda > sda.part.table
sfdisk /dev/sda < sda.part.table

Bootsektor:
dd if=/dev/sda of=/mnt/backup/sda.mbr bs=512 count=1
dd if=/mnt/backup/sda.mbr of=/dev/sda bs=512 count=1

Freitag, 7. November 2008

backup/save/flash/restore edimax br-6104kp openwrt

#### preparing backup pc:
#### linuxmachine 192.168.0.66:
user1@linuxmachine:~/openwrt/tst$ nc -l -p 7777 | dd of=mtdblock2
2978+1485 records in #<---- those lines appear after backup
3968+0 records out
2031616 bytes (2.0 MB) copied, 3.96442 seconds, 512 kB/s

#### preparing openwrt backup
#### "firmware" is including everything except /tmp
root@OpenWrt:/# cat /proc/mtd
dev: size erasesize name
mtd0: 00008000 00004000 "admboot"
mtd1: 00008000 00008000 "config"
mtd2: 001f0000 00010000 "firmware"
mtd3: 000b93e4 00010000 "kernel"
mtd4: 00134c00 00010000 "rootfs"
mtd5: 00070000 00010000 "rootfs_data"

root@OpenWrt:/# mount -o remount,ro /jffs
root@OpenWrt:/# dd if=/dev/mtdblock2 | nc 192.168.0.66 7777
3968+0 records in
3968+0 records out

#### restore:
root@OpenWrt:/# cd tmp/
root@OpenWrt:/tmp# scp user1@192.168.0.66:~/openwrt/tst/mtdblock2 .
root@OpenWrt:/# dd if=/tmp/mtdblock2 of=/dev/mtdblock2 && reboot
3968+0 records in
3968+0 records out

#### original firmware restore: serial cable (slower) or like this:
root@OpenWrt:/tmp# scp user1@192.168.0.66:~/openwrt/tst/orig.bin .
root@OpenWrt:/tmp# mtd -r -e firmware write orig.bin firmware

#### flashing Openwrt to Device: use webinterface (faster) or serial
cable (failsafe) - openwrt/bin has different files for that

##### references:
http://wiki.openwrt.org/BackupAndRestore

Sonntag, 26. Oktober 2008

Device: Edimax BR-6104KP (as I don't use USB, everything should work with BR-6104K)
Goal: Using Device as standard home router with OpenWRT while acting als OpenVPN-tunnelserver, socksproxy and locally as UPNP-server.
cablemodem/whatever.with.ethernet.out-----Edimax.OpenWRt-----local.PCs

A mate of mine has very restricted internet access, can only access http-ports, so i run OpenVPN on port 443 and as simple alternative srelay (the socks-proxy) on port 80. Luckily it is not checked whether using http so i don't have to use a http-tunnel-program.

i posted same stuff here: http://forum.openwrt.org/viewtopic.php?pid=75429#p75429

The Edimax has 2MB flash, but the image has to be smaller than 1780(?) KByte in order for the jffs2-filesystem to work. So in lack of space, OpenVPN etc have to get downloaded and installed on every boot, i wrote some simple start-scripts in etc/rc.d to make this moreorless foolproof - though it would be much nicer to have scripts in /etc/init.d which accept start/stop/restart/enable/disable commands. I provide those file here for adaption, note they won't work out-of-the-box as i replaced passwords and accountnames ... with dummy parameters. My config files start as last files on boot though changing settings could be possilbe earlier, possibly even bevor compiling, but ... it is working and easy to understand.

find the files here: http://www.file-upload.net/download-1209569/files.zip.html

Building the image:
svn co https://svn.openwrt.org/openwrt/trunk/ kamikaze #i got Revision 13021
cd kamikaze/package
svn co https://svn.openwrt.org/openwrt/packages/net/miniupnpd #gets the miniupnp package
cd ..
#copy content of my files.zip/files to kamikaze/files, propably you will have to mkdir files
#adapt all files to your needs and get openvpn-certs,-keys,... see below
#ensure you start with blank config: rm .config, rm .config.old
make menuconfig
--> target system: Infineon ADMtek ADM 5120 2.6
--> Subtarget: Little Endian
--> Target Profile: Edimax BR-6104KP (Unofficial)
--> Target Images: squashfs
#--> Image configuration: not used as done on first boot through files/etc/rc.d/...
--> Base system: # "-":do not install, "*":build-in
-bridge
-busybox ->Networking Utilities -> Enable IPv6 support
-Network --> ppp
*Netword --> miniupnpd #using it as package "M" did not work
-USB-Support kmod-usb-core
*Kernel modules -> Other modules -> kmod-leds-gpio and kmod-ledtrig-adm5120-switch
*Kernel modules -> Network Support -> kmod-tun
make V=99 #use V=99, if not, you might miss some y/n questions and make would not finish

To get the image on the device look here: http://midge.vlad.org.ua/wiki/console_cable (i used a m35 noname(!) serial data cable - you find the image in kamikaze/bin)
The OpenVPN-config is based on this article: http://wiki.openwrt.org/OpenVPNTunHowTo?highlight=(CategoryHowTo)
To create the necessary openvpn-key files look here: http://openvpn.net/index.php/documentation/howto.html#pki (in my files.zip there are just dummies)
To read the logs: logread
To know your dhcp-clients: cat /tmp/dhcp.leases
Telnet the device, set a password --> telnet is automaticly disabled --> ssh -p17777 youredimax

references:
http://wiki.openwrt.org/OpenWrtDocs/Packages
http://forum.openwrt.org/viewtopic.php?id=13767
http://forum.openwrt.org/viewtopic.php?id=14360
http://www.linux-mips.org/wiki/ADM5120_switch
http://downloads.openwrt.org/kamikaze/docs/openwrt.html
http://wiki.openwrt.org/CategoryHowTo?action=show&redirect=OpenWrtHowTo
http://dev.luci.freifunk-halle.net/docsrv/section.firewall.redirect.xml
http://wiki.openwrt.org/OpenWrtDocs/Kamikaze/FirewallConfiguration-warning: some stuff outdated or wrong
http://wiki.openwrt.org/DDNSHowTo?highlight=(CategoryHowTo)
http://openvpn.net/index.php/documentation/howto.html#pki
http://wiki.openwrt.org/OpenVPNTunHowTo?highlight=(CategoryHowTo)

Services running:
wan+lan:
443 OpenVPN
80 srelay
17777 sshd
81 httpd
lan:
23 telnet until you set an password
5000 miniupnpd
53 dnsmasq
67 dhcp-server

blogspot blog sichern

Komplett mit httrack mirrorn dauert zu lange. Schnell und einfach: mit
http://-mein-blog-.blogspot.com/search?max-results=9999 alle posts
anzeigen und einfach file->save machen.
Leider nicht einfach zuzuordnen sind die Kommentare:
http://-mein-blog-.blogspot.com/feeds/comments/default/?max-results=9999

Donnerstag, 25. September 2008

HTTP File Server

danke dafür :-) http://www.rejetto.com/hfs/