PHP Code:
<?php
//if no number is selected. kill the script
if(!isset($_GET['number'])) { //this just checks to make sure we have a number set.
ShowJson("fail", "no number", "no carrier", "no text gateway");
}
$number = $_GET['number'];
if(strlen($number) <> 10) {
ShowJson("fail", "not 10 digits", "no carrier", "no text gateway");
}
$areacode = substr($number, -4);
$prefix = substr($number, -7, 3);
$sufix = substr($number, 0, 3);
//is the number a cingular number? this will check if a number has registered on at&t website. works sometimes.
$data = file_get_contents("https://www.att.com/olam/registrationAction.olamexecute?registrationActionEvent=registrationInProgress&reportActionEvent=A_REGS_IN_PROGRESS_SUB®PreferredLang=E&ctnAreaCode=" . $areacode . "&ctnPrefix=" . $prefix . "&ctnNumber=" . $sufix . "&IDToken1=" . $number . "&ctn=" . $number . "&mid=&ban=&wirelineNumber=&acctType=wirelessNumberLabel&nmb=" . $number . "&x=0&y=0");
$pos1 = strpos($data, "The wireless number you entered is not found in our records"); //check for text
$pos2 = strpos($data, "management is no longer available for this"); //check for more text
$pos = $pos1 + $pos2; //add them together to check the length
if($pos > 0) {
//do nothing. we will try again later on in code.
} else {
ShowJson("OK", $number, "at&t", "txt.att.net");
}
//is number verizon? this will check if number is part of verizon, works everytime.
$data = file_get_contents("http://www.verizonwireless.com/b2c/LNPControllerServlet?&path=friend&mobilePhone1=" . $number);
$pos = strpos($data, "Number is included in the Verizon Wireless Mobile to Mobile Calling Family");
if($pos > 0) {
ShowJson("OK", $number, "verizon", "vtext.com");
}
//try a different method to get the carrier. here we check to see if their carrier supports amber alerts. Most of these do.
$data = file_get_contents("https://www.wirelessamberalerts.org/index.jsp?TN=" . $number . "&CarrierCode=999&InCrossroadsKey=false&subscriberXModeKey=&subscriberModeKey=");
if(strpos($data, "verizon")) {
ShowJson("OK", $number, "verizon", "vtext.com");
} elseif(strpos($data, "at&t")) {
ShowJson("OK", $number, "at&t", "txt.att.net");
} elseif(strpos($data, "cingular")) {
ShowJson("OK", $number, "cingular", "cingularme.com");
} elseif(strpos($data, "metrocall")) {
ShowJson("OK", $number, "metrocall", "page.metrocall.com");
} elseif(strpos($data, "Sprint Nextel")) {
ShowJson("OK", $number, "sprint", "messaging.sprintpcs.com");
} elseif(strpos($data, "t-mobile")) {
ShowJson("OK", $number, "t-mobile", "tmomail.net");
} elseif(strpos($data, "alltel")) {
ShowJson("OK", $number, "alltel", "message.alltel.com");
} elseif(strpos($data, "valid wireless number")) {
ShowJson("fail", "not found", "no carrier", "no text gateway");
} else {
ShowJson("fail", "not found", "no carrier", "no text gateway");
}
function ShowJson($status, $number, $carrier, $txtgateway) {
$data = array('response'=>array('status'=>"$status", 'Number'=>"$number", 'carrier'=>"$carrier",'txt_gateway'=>"$txtgateway"));
echo json_encode($data);
die(); //kill the script after the first result is found.
}
?>
This is my 'what is number's carrier' api

Right now it pretty much works on most at&t numbers and ALL verizon numbers. It will detect most sprint numbers. I couldnt find anyone with t-mobile or the others.
But with this you can pretty much start at your area code, and loop through 0001 to 9999 and see what all numbers are valid.
for me i did 731217-, 731267, 731607, 731234
and got back about 30000 results.
At this point, since you know their carrier you can send emails to them and what not. Of course you see the evilness of this goes only as far as the user is willing to take it. i personally used it for advertisement for my Xion bot locally.
Now to get a response for those who havent worked with json. it will look something like this:
PHP Code:
<?php
$data = file_get_contents("http://acidshower.com/SMS/carrier.php?number=7312676408"); //call the url
$json = json_decode($data, true); //load response into $json
if($json['response']['status'] == 'OK') { //check to see if everything went well
echo $json['response']['txt_gateway']; //show the contents of the array containing the txt_gateway
} else {
echo $json['response']['status'] . ": " . $json['response']['number']; //in carrier.php, if there was an error, i showed it in 'number'.
//thats just what i chose to do
}
?>
The above code will output:
vtext.com
so that means now you create a mail script to send emails.
7312676408@vtext.com
thats my number. dont bomb the fuck out of it
