Jump to content

Katanius

Members
  • Posts

    10
  • Joined

  • Last visited

    Never

Everything posted by Katanius

  1. I also get the following errors: Notice: Trying to get property of non-object in C:\Program Files\Apache Group\Apache2\htdocs\dns\dnsdig.php on line 9 Notice: Trying to get property of non-object in C:\Program Files\Apache Group\Apache2\htdocs\dns\dnsdig.php on line 9 I also get this from another script using the same package: Fatal error: Call to a member function display() on a non-object in C:\Program Files\Apache Group\Apache2\htdocs\dns\dnsspec.php on line 13
  2. I changed the code to this enabeling debug output: <?php // include class file require_once("Net\DNS.php"); // create object $ndr = new Net_DNS_Resolver(); echo $ndr; // uncomment this for debug output $ndr->debug = 1; echo $ndr; // query for IP address $answer = $ndr->search("google.com", "MX"); echo $ndr; // print output print_r($answer); ?> and got this output: Object id #1Object id #1;; search(google.com, MX, IN) ;; query(google.com, MX, IN) ;; using simple sockets Object id #1 What does this mean? does it mean the package works and im doing something wrong or it doent work an just outputs something? I just cant seem to get it to work... and i really need it to work! do you know of anywhare i can get some help with this cause the documentation doesnt help much...
  3. error_reporting is set to E_ALL and i set display_errors = on in the php.ini but still nothing... is there anything else i should check or something i might have forgoten or done wrong?
  4. the code i used is this: <?php require_once 'Net/DNS.php'; $resolver = new Net_DNS_Resolver(); $response = $resolver->query('example.com'); if ($response) { foreach ($response->answer as $rr) { $rr->display(); } } ?> its straight from the documentation example, i also tryied this: <?php // include class file include("Net/DNS.php"); // create object $ndr = new Net_DNS_Resolver(); // uncomment this for debug output // $ndr->debug = 1; // query for IP address $answer = $ndr->search("cnet.com", "A"); // print output print_r($answer); ?> also with no success. this is my include path: ;include_path = "C:\PHP5\PEAR" and this is my php instalation dir: C:\PHP5 the package is installed in: C:\PHP5\PEAR\Net
  5. I use the command line pear command to install the net_DNS package after i made sure i have all needed dependencies, i get installation successfull message, i copy paste the example from the pear.net documantation of Net_DNS to test if its working, i run the script and it returns nothing... I run scripts localy on my comptuter on a windows platform with an Apatche server. What did i do wrong? plz help me.
  6. Can someone help me with this please? At least is there another way to identify web servers that is faster or without using headers? for each host it finds that isn't a web page or server it takes ages to figure it out and move on to the next. what can i do?
  7. I've written a script to scan ip ranges and find live hosts, for each host i find i need to determine what kind of host it is (web server, mail server, ftp server, dns, e.t.c.) how can this be done?? Im new in PHP and im kind of stuck... im also running this script on a windows platform so i cant use get_record and the likes. here's the script: <?php //Set the start and the end of the ip range to be scanned $startofrange='62.169.194.0'; $endofrange='62.169.194.50'; //Create a text file to write the results of the scan $filename = "ScanResult_".date('d-m-y_H-i').".txt"; $fp = fopen($filename,"w")or die("ERROR $filename could not be created"); fwrite($fp,"Scan results: \r\n"); fclose($fp); echo "Starting Scan..."."<br>"; //convert the start and end ip to decimal form to be able to be increased with ++ and be easier to work with $ipstart=ip2long($startofrange); $ipend=ip2long($endofrange); //set infinite time limit so the programm does ot time out and initialize counters set_time_limit(0); $counter=0; //counts ips scanned $hostcount=0; //counts hosts found for( $ip=$ipstart ; $ip<=$ipend ; $ip++ ) //loop from the start of range to the end of range { $counter++; //converts %ip to unsigned to display corrrect value $ipstring=sprintf("%u ",$ip); //opens the created file to write ips scanned and theyr decimal value $fp=fopen($filename,"a")or die("ERROR Could not open $filename"); fputs($fp,"IP=".long2ip($ip)." LongIP=$ipstring"."Host: "); //display the scanned ips to the browser echo "IP=".long2ip($ip)." LongIP="; echo $ipstring." Host: "; $hostname = @nslookup(long2ip($ip)); //uses the created nslookup function to find host if($hostname!=long2ip($ip)) { fputs($fp,"$hostname \r\n"); echo $hostname."<br>"; $hostcount++; } else { fputs($fp,"No Host found! \r\n"); echo "No Host found!"."<br>"; } } //writes in the openned file the number of ips scanned and hosts found and closes the file fputs($fp,"End Of Scan: $counter addresses scanned, $hostcount hosts found. \r\n"); fclose($fp); //displays the number of ips scanned and hosts found echo "Scan Finished: $counter addresses scanned, $hostcount hosts found."; //The nslookup function used above function nslookup ($ipadr) { //uses the external nslookup command to find host informaton //and splits results into an array to keep only the information needed $host = split('Name:',`nslookup $ipadr`); //if a host exists trims spaces of the string returned by nslookup and replaces unusefull information with'' //else returns the ip address $host = ( trim (isset($host[1]) ? str_replace ("\n".'Address: '.$ipadr, '', $host[1]) : $ipadr)); $host = str_replace("\nAliases: ",' Aliases: ',$host); return $host; // returns the host or the ip address if no host found } ?> I've tryed to identify web servers using headers but it takes ages to complete... if($hostname!=long2ip($ip)) { fputs($fp,"$hostname \r\n"); echo $hostname."<br>"; $hostcount++; //determines if host is a web server using headers if(@get_headers("http://$hostname")!=FALSE) { fputs($fp,"WEB-SERVER \r\n"); echo "WEB-SERVER"."<br>"; } } else { fputs($fp,"No Host found! \r\n"); echo "No Host found!"."<br>"; } can someone plz help?
  8. Hello all Is there any way or a function i dont know about to get DNS info/records on a windows platform? checkdnsrr,dns_get_record, getmxrr are not availiable on windows platforms so i tried the PEAR net_DNS class but it doesnt seem to work eventhough i used the package manager and packages installed corectly.. Is there anything else i can do? is there any function i can use without having to install extra packages and classes? ??? the thing i want to do is for a given hostname to find if it is a mail server, web server etc. Am i even walking in the right path with these functions? or should i try something else? Im new in PHP so Id appreciate any help you can give me.
  9. I set the timelimit at 3600 sec and it worked just fine!!! even for 500+ addresses!!! Thank you very much!!! It realy helped!!!
  10. Hi all! Im new to this forum so plz forgive me if am not posting in the right section and if needed move my post. Im writing a simple script that retuns the hosts for a given ip range(im later going to use it as a function). <?php $startofrange='62.112.192.1'; $endofrange='62.112.192.50'; $ipstart=ip2long($startofrange); $ipend=ip2long($endofrange); for( $ip=$ipstart ; $ip<=$ipend ; $ip++ ) { echo long2ip($ip)."="; echo $ip."="; $hostname = gethostbyaddr($ip); echo $hostname."<br>"; } ?> The broblem is that at some point it just stops in the middle of the loop an does not finish the scan of the given ips eventhough at the time it stops it has not reached the ip given as the end of the ip range. It just stops... I really cant figure out whats wrong.. Im not realy experienced in php so plz, could anyone help me with this? What am i doing wrong?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.