Advertisement
FlyFar

pages/target.php

Sep 2nd, 2023
732
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.05 KB | Cybersecurity | 0 0
  1. <?php
  2. ini_set('display_errors', 'on');
  3. require_once('config/config.php');
  4.  
  5. if(isset($_GET['insert']) && isset($_GET['nb_file']) && !empty($_GET['nb_file']) && is_numeric($_GET['nb_file'])){
  6.     $address_ip = $_SERVER['REMOTE_ADDR'];
  7.     $arch = "x64";
  8.     $nb_file = $_GET['nb_file'];
  9.     $day = date("d")+1;
  10.     $month = date('m');
  11.     $year = date('y');
  12.     $hours = date('h:i:s');
  13.     $date = $month.'/'.$day.'/'.$year.' '.$hours;
  14.     echo $address_ip;
  15.     $select = $bdd->prepare("SELECT * FROM target WHERE ip_adress = :ip_addr");
  16.     $select->bindParam(':ip_addr', $address_ip);
  17.     $select->execute();
  18.     if($select->rowCount() < 1){
  19.     var_dump($select->fetch());
  20.     $insert = $bdd->prepare("INSERT INTO target(ip_adress,nb_file,system_arch,date_time) VALUES(:ip_addr,:nb_file,:arch,:date_time)");
  21.     $insert->bindParam(':ip_addr', $address_ip);
  22.     $insert->bindParam(':nb_file', $nb_file);
  23.     $insert->bindParam(':arch', $arch);
  24.     $insert->bindParam(':date_time', $date);
  25.     $insert->execute();
  26.     echo "inserted";
  27.     }
  28. }
  29. else{
  30.     echo "get not set";
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement