elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Rompecabezas de Bitcoin, Medio millón USD en premios


+  Foro de elhacker.net
|-+  Programación
| |-+  Scripting
| | |-+  codigo script para hacer ping en php
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: 1 [2] Ir Abajo Respuesta Imprimir
Autor Tema: codigo script para hacer ping en php  (Leído 22,565 veces)
stack


Desconectado Desconectado

Mensajes: 472



Ver Perfil
Re: codigo script para hacer ping en php
« Respuesta #10 en: 29 Enero 2022, 15:32 pm »

Citar
Ya encontre una solusion alternativa muy buena, pero no la posteare aqui, ...

Tipejos así sobran en este Foro, deberian banearlo.

Cuando pregunte algo más, no le respondais, mandarlo a....Google.


En línea

ad maiora natus sum
condorito

Desconectado Desconectado

Mensajes: 65


Ver Perfil WWW
Re: codigo script para hacer ping en php
« Respuesta #11 en: 10 Mayo 2022, 05:33 am »

 :P ya se me paso el enojo  :-\
Paso a explicar un codigo para monitoreo de ping a una web o ip de forma online en php

EXPLICADO PARA PRINCIPIANTES Y PARA NO PRINCIPIANTES, DE HECHO ESTE SCRIPT ESTA ARMADO DE TAL FORMA QUE SOLO HACE FALTA CAMBIAR EL LINK DE LA WEB "twitter.com" POR LA WEB A LA QUE QUIERAS TESTEAR O POR UNA IP TAMBIEN , EL CODIGO ESTA ARMADO TENIENDO EN CUENTA PAGINAS CON EL HTTPS ACTIVADO, SI QUERES TESTEAR ALGUNA WEB QUE NO TIENE EL HTTPS ACTIVADO, DEBES CAMBIAR EN DONDE VEAS HTTPS POR HTTP Y DONDE VEAS 443 CAMBIALO POR 80 , EN CASO DE TESTEAR UNA WEB CON HTTPS ACTIVADO (EN LA MAYORIA DE LOS CASOS) NO HACE FALTA CAMBIARLE NADA, SOLO DEBES CAMBIAR EN DONDE ESTE EL LINK TWITTER.COM POR LA WEB QUE QUIERAS

HAY UN "SECRETO " PARA HACER UNA WEBSITE MAS FIRME O DURA FRENTE A LOS ATAQUES DE DDOS, Y ESE "SECRETO" ES ACOSTUMBRARSE A HACER UN MONITOREO PRACTICAMENTE CONSTANTE DE MONITOREO DE PINGS PREFERENCIALMENTE USAR UNA APP LLAMADA "PINGTOOLS" TIENE UN MENU DE ''PINGS'' EN EL QUE EN SU CONFIGURACION LE PODREMOS CONFIGURAR DE QUE EL MONITOREO SEA CONSTANTE, CON TIEMPO DE ESPERA DE RESPUESTA EN VALOR 3000 MILISEGUNDOS, EN MONITOREO A PROTOCOLO HTTPS , REALIZAR PINGS DE FORMA ONLINE TAMBIEN ES UTIL Y PARA ESO ES ESTE CODIGO SCRIPT , PORSUPUESTO QUE DE ENTENDER BIEN COMO funciona PODRAS MOFIFICARLO A TU GUSTO POR EJEMPLO EN DONDE ESTA EL CODIGO QUE ACTUALIZA LA PAGINA LO DEJE DE MODO QUE REFRESQUE CADA 7 SEGUNDOS (7000 milisegundos)  VOS PODRAS ACORTARLO A CADA CINCO O COMO PREFIERAS, ESO CUMPLE LA FUNSION DE QUE CADA VEZ QUE SE ACTUALIZA SE ACTIVA EL TESTEO DE PING Y MUESTRA EL NUMERO DE RETRASO DE LATENCIA DE RESPUESTA EN MILISEGUNDOS - EN ESTA WEB PODES VER COMO QUEDA EL MONITOREO DE PING CONSTANTE https://misteriosinexplicables.com/pingtwitter.php

Código:
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="https://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"g">
 
<link rel="SHORTCUT ICON" type="chliz" href="https://blogger.googleusercontent.com/img/a/AVvXsEhWCIUYzvoa2MvpVAJUwyJGHNeOlH4m7bMA538Ozm8in-d0Yojta68D6lDDXWiNi38nG8PVhTYIKrQGjp9Zen9MRhDld7yDOr_bOBEgbqzCzdrPqWEdP0aazbxr1qB_UgKOWHElf_ZcAV1VI80dgJV8Zb5RB90_-6voGvVHU3ypVN3FtTqX5DtUH7dS=s320">
<title>ping online</title>

🛰 🛰 🛰 🛰 🛰 🛰 🛰 🛰 🛰 🛰 🛰 🛰 🛰 🛰 🛰 🛰 🛰 🛰
<style type="text/css">
body {

background-repeat: no-repeat;
background-position: right;
background-attachment: fixed;
background-color: #546bfe;
margin-top: 5%;
margin-bottom: 5%;
margin-left: 15%;
margin-right: 15%;
font-family:"Courier New", Courier, monospace;
color: #FFFFFF;
}
fieldset {
border-style: none;
margin: 10px;
}
p {
margin: 0;
}
input {
margin: 0;
background-color: transparent;
border: none;
text-align: center;
font-family:"Courier New", Courier, monospace;
color: #FFFFFF;
}
</style>
<script language="javascript">
<!-- Disable
function disableselect(e){
return false
}
function reEnable(){
return true
}
//if IE4+
document.onselectstart=new Function ("return false")
document.oncontextmenu=new Function ("return false")
//if NS6
if (window.sidebar){
document.onmousedown=disableselect
document.onclick=reEnable
}
//-->
</script>
</head>
<body onLoad="type()">
<fieldset>

<div id="hive" align="center">
<font color="#FF0000">[</font>TARGET<font color="#FF0000">]</font><br>
:::::::::::::::::::PING A TWITTER.COM::::::::::::::::::::::
<input name="target" id="target" size="77" value="https://twitter.com"><br><br>
<font color="#FF0000">[</font>PETICIONES<font color="#FF0000">]</font><br>
<input id="requests" size="77" value="1"><br><br>
<font color="#FF0000">[</font>106 bytes<font color="#FF0000">]</font><br>
<input id="message" size="77" value="1"><br><br>
<font color="#FF0000">[</font>STATUS<font color="#FF0000">]</font><br>
SOLICITUDES <p id="requested">0</p>
LOGROS <p id="succeeded">0</p>
FALLIDOS <p id="failed">0</p><br>
<button id="fire" style="background-color:#000000; border-color: rgb(255, 255, 255); color: rgb(255, 255, 255);"> Stop </button><br><br><br>
</div>

<script>
(function () {
var fireInterval;
var isFiring = false;
var currentTime = new Date();
var lastSuccess = currentTime.getTime();
 
var requestedNode = document.getElementById("requested"),
succeededNode = document.getElementById("succeeded"),
failedNode = document.getElementById("failed"),
targetNode = document.getElementById("target"),
fire = document.getElementById("fire"),
messageNode = document.getElementById("message"),
requestsNode = document.getElementById("requests"),
timeoutNode = document.getElementById("timeout");
 
var target = targetNode.value;
targetNode.onchange = function () {
target = this.value;
};
 
var requestsHT = {};
 
var requested = 0,
succeeded = 0,
failed = 0;
 
var makeHttpRequest = function () {
if ( (currentTime.getTime()-lastSuccess) > 10000) {
return;
} else {
lastSuccess = currentTime.getTime();
};
 
var rID =Number(new Date());
 
var img = new Image();
img.onerror = function () { onFail(rID); };
img.onabort = function () { onFail(rID); };
img.onload = function () { onSuccess(rID); };
img.setAttribute("src", target + "?id=" + rID + "&msg=" + messageNode.value);
requestsHT[rID] = img;
onRequest(rID);
};
 
var onRequest = function (rID) {
requested++;
requestedNode.innerHTML = requested;
};
 
var onComplete = function (rID) {
delete requestsHT[rID];
};
 
var onFail = function (rID) {
// failedCtr++;
//failedCtrNode.innerHTML = failedCtr;
succeeded++; //Seems like the url will always fail it it isn't an image
succeededNode.innerHTML = succeeded;
delete requestsHT[rID];
};
 
var onSuccess = function (rID) {
succeeded++;
succeededNode.innerHTML = succeeded;
delete requestsHT[rID];
};
 
fire.onclick = function () {
if (isFiring) {
clearInterval(fireInterval);
isFiring = false;
this.innerHTML = "FIRE!";
} else {
isFiring = true;
this.innerHTML = "STOP!";
fireInterval = setInterval(makeHttpRequest, (2000 / parseInt(requestsNode.value) | 0));
}
};
 
function start() {
if (isFiring) {
clearInterval(fireInterval);
isFiring = false;
this.innerHTML = "FIRE!";
} else {
isFiring = true;
this.innerHTML = "STOP";
fireInterval = setInterval(makeHttpRequest, (1000 / parseInt(requestsNode.value) | 0));
}
};
document.getElementById("target").value = "https://twitter.com";
start();
})();
</script>
</fieldset>

<script type="text/javascript">
function actualizar(){location.reload(true);}
//Refresca cada 7 segundos! (7000 milisegundos)
setInterval("actualizar()",7000);
</script>
</body>
</html>


<input onclick="location.reload()" type="button" value="⏩ REFRESH ⏩" />
    📡   
    <?php

function ping($host, $port, $timeout)
{
  $tB = microtime(true);
  $fP = fSockOpen($host, $port, $errno, $errstr, $timeout);
  if (!$fP) { return "down"; }
  $tA = microtime(true);
  return round((($tA - $tB) * 1000), 0)." ms";
}

//Echoing it will display the ping if the host is up, if not it'll say "down".
echo ping("twitter.com", 443, 443);

?>
   
  .......
    <?php
     
$wait = 2; // ping...
$host = 'twitter.com';
$ports = [
    'https' => 443,
];

foreach ($ports as $key => $port) {
    $fp = @fsockopen($host, $port, $errCode, $errStr, $wait);
    echo "Ping $host:$port ($key) ✔";
    if ($fp) {
        echo'✔';
        fclose($fp);
    } else {
        echo "ERROR: $errCode - $errStr";
    }
    echo PHP_EOL;
}
 


En línea

Danielㅤ


Desconectado Desconectado

Mensajes: 1.675


🔵🔵🔵🔵🔵🔵🔵


Ver Perfil
Re: codigo script para hacer ping en php
« Respuesta #12 en: 11 Mayo 2022, 02:14 am »

Hola condorito, primero gracias por el aporte, pero 2 cosas:

1. La explicación no debería estar en mayúsculas porque además de considerarse gritar, también cuesta leer.

2. No hacía falta poner tu sitio web al final de la explicación porque eso es spam, incluso aunque sea una URL que apunte a un archivo PHP.


Saludos
En línea

.xAk.


Desconectado Desconectado

Mensajes: 397


F0r3v3R NeWbI3


Ver Perfil WWW
.
« Respuesta #13 en: 21 Mayo 2022, 02:14 am »

.
En línea


condorito

Desconectado Desconectado

Mensajes: 65


Ver Perfil WWW
Re: codigo script para hacer ping en php
« Respuesta #14 en: 2 Julio 2022, 08:33 am »

Hola condorito, primero gracias por el aporte, pero 2 cosas:

1. La explicación no debería estar en mayúsculas porque además de considerarse gritar, también cuesta leer.

2. No hacía falta poner tu sitio web al final de la explicación porque eso es spam, incluso aunque sea una URL que apunte a un archivo PHP.


Saludos

UFF NO SEAS MALA ONDA, CALMATE UN POCO  :xD :xD :xD
« Última modificación: 2 Julio 2022, 08:42 am por condorito » En línea

Danielㅤ


Desconectado Desconectado

Mensajes: 1.675


🔵🔵🔵🔵🔵🔵🔵


Ver Perfil
Re: codigo script para hacer ping en php
« Respuesta #15 en: 2 Julio 2022, 14:55 pm »

El spam no está permitido y de hecho tampoco sirve, un sitio web no se hace conocido por el spam.
En línea

Páginas: 1 [2] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
Alguien tiene el code para hacer ping ?¿
Programación Visual Basic
gmf_321 1 1,779 Último mensaje 3 Octubre 2006, 02:28 am
por USUARIO_DE_SOFTWARE_LIBRE
Bucle Bach para hacer un ping
Scripting
p_mederos 2 5,868 Último mensaje 2 Febrero 2011, 13:06 pm
por flony
Programa para hacer ping desde red ajena.
Programación C/C++
KisakuIto 2 4,450 Último mensaje 2 Octubre 2011, 10:46 am
por KisakuIto
Script batch para ping « 1 2 »
Scripting
terrateck 14 20,719 Último mensaje 20 Junio 2013, 01:04 am
por engel lex
Hacer Ping en codigo C y que cree un txt con los resultados de cada IP « 1 2 »
Programación C/C++
rubia28 11 10,579 Último mensaje 18 Noviembre 2020, 17:44 pm
por rubia28
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines