Results 1 to 14 of 14

Thread: Useful scripts and one-liners

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2007
    Location
    Austria
    Posts
    1,336

    Post Useful scripts and one-liners

    Viele verwenden den Router seit Jahren mit verschiedenen Anwendungen.
    Ich stelle hier meine Scripte und Einzeiler für alle User zur Verfügung und rufe auch andere User dazu auf.
    Bitte nur getestete Scripts und Einzeiler posten. Für Fragen bitte unbedingt einen anderen Thread öffnen - Danke.
    Ein guter Platz zum speichern der Scripte ist /tmp/local/bin oder /opt/bin oder /opt/sbin.
    Bitte die Rechte der Scripte auf 755 setzen !

    Many of us use the router for years with various applications.
    I present here my scripts and one-liners for all users and call other users to do the same.
    Please post just well tested scripts and one-liners. For questions please open a new thread - thank you.
    A good place to store the scripts is /tmp/local/bin or /opt/bin or /opt/sbin
    Please set the rights of scripts to 755 !

    List of scripts and one-liners (alphabetical order)

    Name Beschreibung / Description

    avbf Schutz vor brute force Angriff (nur AP Mode), avoid brute force in AP Mode German english
    getip zeigt die IP's vom Interface an, shows you the ip of any interface
    getrepo Speichere das gesamte Repository, download a complete repository
    lcom Liste alle Commandos vom Router, list all commands on router
    symlinks Zeige symbolische Links in Verzeichnissen, list symbolic links of directories
    shorten Kürzt Config Files, shorten config-files
    Einzeiler1 Ein Image einer ganzen Partition via ssh auf einen enternten Rechner. Store a complete image of a partition via ssh on a remote machine.
    Portscan Make a list of Portscan from Logfile
    Last edited by newbiefan; 09-04-2012 at 10:23.
    Alle HowTo's, all howto's

    RT-N16 1.9.2.7-rtn-r3121, Samba, VSFTP, Lightthpd, PHP, Perl, MySQL, Serendipity, Aria2web, HDD 640GB
    RT-N66U, 16GB MicroSD/ 2 Partitions, 2,5" HDD 1TB, running with Merlin's FW and Entware, 16 Mbit A1,
    Netgear DGND 3700V2, QNAP TS119PII 4 TB, QNAP TS209 2 TB Raid1, Backup Synology DS107+ 1 TB, HP CP1515n

  2. #2
    Join Date
    Jul 2007
    Location
    Austria
    Posts
    1,336

    script avbf

    Der Script avbf schützt sie vor Angriffe aus dem Internet (Port 21 & 22) wenn der Asus im AP Mode hinter einem Modem/Router
    hängt. Entpacken sie den Script auf ihrem PC. Speichern sie den Script am Router. Die Datei hosts.deny speichern sie am
    Router nach /opt/etc/host.deny
    Nun tragen sie den Aufruf des Scripts in /tmp/local/sbin/post-mount unmittelbar vor dem Aufruf von rc.unslung ein.
    Wenn sie einen anderen Speicherort für ihre host.deny Datei verwenden, ändern sie die entsprechende Variable in avbf.
    Die verwendete host.deny Datei sperrt den gesamten Asien-pazifischen Raum sowie einige auf Afrika und wenige
    besonders lästige Script-Kiddies aus den USA, meist nur College oder Unis. Beobachten sie ihren Logfile besonders genau -
    wenn sie gefährliche oder wiederkehrende Angreifer finden, fragen sie einfach "whois ip" auf der Kommandozeile.
    Tragen sie die gesamte IP-Range/Netmask (cidr) in die hosts.deny Datei ein. Nach einem Neustart ist auch diese Ip-Range
    gesperrt. Weiters sollten sie gelegentlich ein "iptables -nvL" ausführen und nachsehen, aus welcher IP-Range besonders
    viele (natürlich) sinnlose Zugriffe erfolgten. Wenn aus einer IP-Range sehr lange keine versuchten Zugriffe erfolgt sind,
    können diese in der hosts.deny Datei ausgetragen werden. Ein probates Hilfsmittel wird der etwas später gepostet Script
    ipts sein, die Ausgabe iptables -nvL wird in einer eigens angelegten Datei gespeichert (Datum_und_Uhrzeit).
    Manchmals taucht die Frage auf, daß whois nicht auf dem Router sei - lol - hier müssen sie das Repo bemühen.

    Bitte kontrollieren sie den Pfad (Variable) im Script avbf auf die Richtigkeit des Speierortes von ipt_recent. Die verschiedenen Versionen der FW haben auch unterschiedliche Speicherorte.
    Viel Spass

    Diese Version ist für Kernel 2.4!
    Attached Files Attached Files
    Last edited by newbiefan; 09-04-2012 at 13:26.
    Alle HowTo's, all howto's

    RT-N16 1.9.2.7-rtn-r3121, Samba, VSFTP, Lightthpd, PHP, Perl, MySQL, Serendipity, Aria2web, HDD 640GB
    RT-N66U, 16GB MicroSD/ 2 Partitions, 2,5" HDD 1TB, running with Merlin's FW and Entware, 16 Mbit A1,
    Netgear DGND 3700V2, QNAP TS119PII 4 TB, QNAP TS209 2 TB Raid1, Backup Synology DS107+ 1 TB, HP CP1515n

  3. #3
    Join Date
    Jul 2007
    Location
    Austria
    Posts
    1,336

    Script getip

    getip zeigt ihnen die IP-Adresse vom gewünschten Interface an. Wenn sie nicht wissen sollten, welche Interfaces
    verfügbar sind, geben sie nur getip ein. Syntax: getip br0 (oder irgend ein gültiges Interface)

    getip shows you the ip of a valid interface. If you don't know which interfaces are available, just enter getip.
    Syntax: getip br0

    Viel Spass - have fun

    Diese Version ist für Kernel 2.4 und Kernel 2.6
    Attached Files Attached Files
    Last edited by newbiefan; 09-04-2012 at 13:27.
    Alle HowTo's, all howto's

    RT-N16 1.9.2.7-rtn-r3121, Samba, VSFTP, Lightthpd, PHP, Perl, MySQL, Serendipity, Aria2web, HDD 640GB
    RT-N66U, 16GB MicroSD/ 2 Partitions, 2,5" HDD 1TB, running with Merlin's FW and Entware, 16 Mbit A1,
    Netgear DGND 3700V2, QNAP TS119PII 4 TB, QNAP TS209 2 TB Raid1, Backup Synology DS107+ 1 TB, HP CP1515n

  4. #4
    Join Date
    Jul 2007
    Location
    Austria
    Posts
    1,336

    Script getrepo

    Zieht ein komplettes Repository (optware) und speichert es auf ihrer HDD im Ordner /tmp/mnt/disc0_3/repository. Dazu wird
    automatisch ein Unterordner mit dem Datum und Zeit als Name erstellt. Syntax: getrepo &

    A complete repository is downloaded and stored onto your hdd in directory /tmp/mnt/disc0_3/repostitory. Further, a subdir is
    created with date and time as name. Syntax: getrepo &

    Viel Spass - have fun

    Diese Version ist für Kernel 2.4
    Attached Files Attached Files
    Last edited by newbiefan; 09-04-2012 at 13:27.
    Alle HowTo's, all howto's

    RT-N16 1.9.2.7-rtn-r3121, Samba, VSFTP, Lightthpd, PHP, Perl, MySQL, Serendipity, Aria2web, HDD 640GB
    RT-N66U, 16GB MicroSD/ 2 Partitions, 2,5" HDD 1TB, running with Merlin's FW and Entware, 16 Mbit A1,
    Netgear DGND 3700V2, QNAP TS119PII 4 TB, QNAP TS209 2 TB Raid1, Backup Synology DS107+ 1 TB, HP CP1515n

  5. #5
    Join Date
    Jul 2007
    Location
    Austria
    Posts
    1,336

    Script lcom

    Listet alle verfügbaren Kommandos des Routers auf. Berücksichtigen sie, dass manchmal eine Umleitung der Ausgabe sehr
    nützlich ist. Dadurch können sie in Ruhe die verfügbaren Befehle studieren.
    Syntax: lcom oder lcom > /tmp/kommandos.txt

    Lists all available commands of the router. Consider that a redirection of stdout is sometimes very useful. This allows
    you a deeper study of available commands.
    Syntax: lcom or lcom > /tmp/commands.txt


    EDIT:
    Wenn jemand die coreutils usw. Doppelanzeige nicht sehen will, einfach: lcom | grep -v - > /tmp/kommandos.txt
    If a user don't want to see the double-output of coreutils aso. just use: lcom | grep -v - > /tmp/commands.txt


    Viel Spass - have fun

    Diese Version ist für Kernel 2.4 und Kernel 2.6
    Attached Files Attached Files
    Last edited by newbiefan; 09-04-2012 at 13:28.
    Alle HowTo's, all howto's

    RT-N16 1.9.2.7-rtn-r3121, Samba, VSFTP, Lightthpd, PHP, Perl, MySQL, Serendipity, Aria2web, HDD 640GB
    RT-N66U, 16GB MicroSD/ 2 Partitions, 2,5" HDD 1TB, running with Merlin's FW and Entware, 16 Mbit A1,
    Netgear DGND 3700V2, QNAP TS119PII 4 TB, QNAP TS209 2 TB Raid1, Backup Synology DS107+ 1 TB, HP CP1515n

  6. #6
    Join Date
    Jul 2007
    Location
    Austria
    Posts
    1,336

    Script symlinks

    Script symlinks
    Zeigt alle symbolischen Links des jeweiligen oder beliebigen Verzeichnisses an. Jeder Profi weiss, wie schwierig man
    sinnlose symbolische Links wieder los wird.
    Syntax: symlinks zeigt die symb. Links des verwendeten Verzeichnisses
    symlinks /opt/sbin usw.
    ACHTUNG: Bitte nicht die Wurzel nehmen (/) dann besteht die Möglichkeit, dass sich der Script aufhängt.

    Shows all symolic links of the/or any directory. Any professional knows how hard it is to remove senseless symbolic links.
    Syntax: symlinks shows sybolic links of the current directory
    symlinks /opt/sbin a.s.o. shows you symbolic links of any directory

    Viel Spass - have fun

    Diese Version ist für Kernel 2.4
    Attached Files Attached Files
    Last edited by newbiefan; 09-04-2012 at 13:29.
    Alle HowTo's, all howto's

    RT-N16 1.9.2.7-rtn-r3121, Samba, VSFTP, Lightthpd, PHP, Perl, MySQL, Serendipity, Aria2web, HDD 640GB
    RT-N66U, 16GB MicroSD/ 2 Partitions, 2,5" HDD 1TB, running with Merlin's FW and Entware, 16 Mbit A1,
    Netgear DGND 3700V2, QNAP TS119PII 4 TB, QNAP TS209 2 TB Raid1, Backup Synology DS107+ 1 TB, HP CP1515n

Similar Threads

  1. How to execute php scripts ?
    By simistef in forum WL-500gP Q&A
    Replies: 13
    Last Post: 11-03-2008, 09:35
  2. Replies: 0
    Last Post: 11-07-2007, 12:58
  3. IP Start-scripts for IP-UP and IP-DOWN
    By rj.2001 in forum WL-500g Q&A
    Replies: 7
    Last Post: 09-07-2007, 16:14
  4. Post Your Useful Scripts
    By tomilius in forum WL-500g Custom Development
    Replies: 2
    Last Post: 05-06-2005, 10:01
  5. Shell scripts and post-boot
    By samoht in forum WL-500g Q&A
    Replies: 5
    Last Post: 03-06-2005, 23:58

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •