Benutzer-Werkzeuge

Webseiten-Werkzeuge


metasploit

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen Revision Vorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
metasploit [2025/11/14 22:28]
admin [Sonstige]
metasploit [2025/11/14 22:42] (aktuell)
admin [Sonstige]
Zeile 239: Zeile 239:
       {       {
         'RPORT' => 80,         'RPORT' => 80,
-        'RHOSTS' => '192.168.0.157'+        'RHOSTS' => '192.168.0.157', 
 +        'URI' => '/'
       },       },
       'DefaultTarget'  => 0))       'DefaultTarget'  => 0))
Zeile 392: Zeile 393:
     end     end
   end   end
 +end
 +</code>
 +
 +
 +<code ruby>
 +# MySampleModule
 + 
 +class MetasploitModule < Msf::Exploit::Remote
 +  Rank = NormalRanking
 + 
 +  include Msf::Exploit::Remote::Tcp
 + 
 +  def initialize(info = {})
 +    super(update_info(info,
 +      'Name'           => 'My sample Exploit',
 +      'Description'    => %q{
 +        This file illustrates how to write a module.
 +      },
 +      'License'        => 'UnLicense',
 +      'Author'         => ['mbrain'],
 +      'References'     =>
 +        [
 +          [ 'CVE', '1234-5678' ],
 +        ],
 +      'Payload'        =>
 +        {
 +          'Space'    => 1000,
 +          'BadChars' => "\x00",
 +        },
 +      'Targets'        =>
 +        [
 +          [
 +            'Windows XP/Vista/7/8',
 +            {
 +              'Platform' => 'win',
 +              'Ret'      => 0x41424344
 +            }
 +          ],
 +        ],
 +      'DisclosureDate' => 'Apr 1 2013',
 +      'DefaultOptions' =>
 +        {
 +          'RPORT'  => 80,
 +          'RHOSTS' => '192.168.0.157'
 +        },
 +      'DefaultTarget'  => 0
 +    ))
 + 
 +    register_options(
 +      [
 +        Opt::RPORT(4444) # Beispieloption für den Remote-Port
 +      ]
 +    )
 +  end
 + 
 +  # Usually this includes code for checking
 +  def check
 +    CheckCode::Vulnerable
 +  end
 + 
 +def exploit
 +  print_status("Baue TCP-Verbindung zu #{rhost}:#{rport} auf...")
 +  connect
 +
 +  uri = '/'
 +  print_status("Sende langsamen HTTP GET Request an #{rhost}:#{rport}#{uri} ...")
 +
 +  # 1) Request-Line
 +  sock.put("GET #{uri} HTTP/1.1\r\n")
 +  sleep(1)  # 1 Sekunde Pause – nur Demo
 +
 +  # 2) Host-Header
 +  sock.put("Host: #{rhost}\r\n")
 +  sleep(1)
 +
 +  # 3) User-Agent
 +  sock.put("User-Agent: SlowDemoMetasploit\r\n")
 +  sleep(1)
 +
 +  # 4) Connection-Header
 +  sock.put("Connection: close\r\n")
 +  sleep(1)
 +
 +  # 5) Leere Zeile zum Abschließen des Headers
 +  sock.put("\r\n")
 +
 +  print_status("Request komplett geschickt, warte auf Antwort...")
 +
 +  # Antwort lesen (einmalig)
 +  response = sock.get_once(-1, 5)  # bis zu 5 Sekunden warten
 +
 +  if response
 +    print_good("Antwort erhalten:")
 +    print_line(response)
 +  else
 +    print_warning("Keine Antwort erhalten (Timeout).")
 +  end
 +
 +  disconnect
 +end
 end end
 </code> </code>
metasploit.1763155735.txt.gz · Zuletzt geändert: 2025/11/14 22:28 von admin