Jump to content
ZKS

Get nologin country,region,city

Recommended Posts

Am facut un mic script, pare folositor NL GeoLocation :RST:

<?php 
include_once('get_string_between.php');
$ips = $_REQUEST['ips'];
$ips = explode("\n", $ips);

foreach ($ips as $line) {

$ips = explode(":", $line);
$ip = $ips[0];
$user = $ips[1];
$pass = $ips[2];

$f = file_get_contents('http://clientn.mask-myip.com/map/whatismyip.php?IP='.$ip);
$country = get_string_between($f, "Country: ", "</div>");
$region = get_string_between($f, "Region: ", "</div>");
$city = get_string_between($f, "City: ", "</div>");
$data = "$ip:$user:$pass //Details :$country=>$region=>$city".PHP_EOL;
echo "$data<br>";
}
?>

si get_string_between

<?php
function get_string_between($string, $start, $end){
$string = " ".$string;
$ini = strpos($string,$start);
if ($ini == 0) return "";
$ini += strlen($start);
$len = strpos($string,$end,$ini) - $ini;
return substr($string,$ini,$len);
}
?>

Edited by ZKS
Link to comment
Share on other sites

In primul rand nu functioneaza.

Introduc


46.55.38.204
46.55.38.204
46.55.38.204

Si primesc in loc


46.55.38.203: //Details :-=>-=>-

Si pe langa asta, mai am unele mici intrebari

1. La ce te referi prin "pass"

2. De ce ai baga o simpla functie intr-un fisier separat si sa-l incluzi cand poti sa pui functia direct in fisierul respectiv.

Link to comment
Share on other sites

am rezolvat, m`am grabit si faceam echo doar la ultimul...si da, aveam impreasia ca e ip: pass..cand e ip:user: pass..modific imediat, merci...si functia aia o am asa ca o folosesc mai mereu si asa ramane si codul mai curat

//done

146.55.38.203:user: pass //Details :UNITED STATES=>ARIZONA=>FT. HUACHUCA

Edited by ZKS
Link to comment
Share on other sites

Uite si varianta mea.

<?php

$file = 'vuln.txt';

$data = file($file);

$content = '';

foreach($data as $val) {

$ip = trim(end(explode(":", $val)));

$location = json_decode(file_get_contents("http://freegeoip.net/json/".$ip));

$content .= trim($val) . " " . $location->country_name . ", " . $location->city . "\n" ;

}

file_put_contents($file, $content);

?>

  • Upvote 1
Link to comment
Share on other sites

folosesti json_decode destul de greu de instalat mai ales in opensuse. Nu cred ca ajuta prea multa lume. Este destul de complicat sa instalezi devel in unele sisteme. Ai putea incerca ceva cURL. Mult mai practic si functioneaza pe orice sistem cu php-curl

Link to comment
Share on other sites

folosesti json_decode destul de greu de instalat mai ales in opensuse. Nu cred ca ajuta prea multa lume.

E o tampenie, cum sa nu ajute pe multi ca are json_decode. Eu nu am intalnit nici un server php care sa nu aiba functia json_decode. De ce ai folosi cURL cand se poate mai simplu.

Link to comment
Share on other sites

O sa intalnesti :) Infine, nu am spus ca nu este OK ceea ce a postat. Facusem ceva de acest gen in curl. Era mult mai practic am cautat sursa sa o postez dar nu mai dau de ea. Ca sa poti folosi functia json_decode ai nevoie de php-devel. Pe sisteme luate prin bruteforce este destul de greu sa instalezi devel.. daca nu ai drept chiar imposibil asa cURL au majoritatea. Avand in vedere ca majoritatea foloseste sursa intr-o masina virtuala este foarte practic si versiunea cu json_decode.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...