홈으로 홈으로 | 무료회원가입 | 아이디/비번찾기 | 즐겨찾기
추천음악방송메인홈1대1상담음악방송청취
운.영.자.1대1.상담

온라이브음악방송
온라이브스토어(앱다운로드)
아리랑가요(무료음악채널)
뽕짝아가씨(무료음악채널)
okTrot(무료음악채널)
전통가요(무료음악채널)

환상의뽕짝파티 무료음악
명작트로트메들리 무료음악
트로트메들리관광 무료음악
동영상노래방
가사검색

POP Player
신나는 고스톱
컴퓨터 오목
작은 음악다방
최신 인기가요

보안∵서버∵쿠키
윈도우∵프레임
이미지∵배경
시간∵달력∵계산
상태바∵타이틀바
음악∵영상
폼∵전송∵테이블
키보드∵마우스
효과∵링크∵메뉴
Script∵php
기타
PHP 강좌
윈도우관련팁
웹관련팁
홈페이지제작팁
기본강좌
레지스트리
윈도우서버
리눅스서버
Android
웹 포트 모니터링 툴
12년 전
<?
// indent rule
// vi:ts=4 sts=4 sw=4

        ## 포트모니터링
        ## 2005.03.17  오후 11:48:40 by Ulovem.com


switch ($type)
{
        case "type1":
                        
        if ($cmd == "")
        {
                $par = "$PHP_SELF?type=$type";
        ?>
        <html>
        <head>
        <meta http-equiv="Content-Type" content="text/html; charset=ks_c_5601-1987" />
        <link rel=StyleSheet HREF="http://ulovem.com/startpage/style.css" type=text/css title=style>
        <Script Language="JavaScript">
                function fnSubmit(val)
                {
                        if (val == "Start" )
                        {
                                document.q.interval.value = 0;
                        } else if (val == "end" ) {
                                document.q.interval.value = 0;
                                document.all.ifr.src="about:blank";        
                                return;
                        } else if (val == "monitor") {
                                document.all.ifr.src="about:blank";        
                                document.q.remaindtime.value = document.q.interval.value;
                        }
                        document.q.scanning.value = "y";        
                        document.all.ifr.src ="<?=$PHP_SELF?>?type=1&cmd=checkip";
                }
        
                function fnRefresh()
                {
                        if (document.q.scanning.value == "n" && document.q.remaindtime.value == 0 && document.q.interval.value != 0)
                        {
                                document.q.remaindtime.value = document.q.interval.value;
                                fnSubmit("monitor");
                        }
                        setTimeout(fnRefresh, 1000);
                }
        </Script>
        </head>
        <body onLoad="fnRefresh();">
        <table height=100% border=1>
        <tr>
                <Td valign=top height=10 colspan=2 width=100% align=center >
                        Web Port Scanner Ver 1.0 for ulovem.com <a href="<?=$PHP_SELF?>?type=1">TYPE 1</a>  <a href="<?=$PHP_SELF?>?type=2">TYPE 2</a></td>
        </tr>
        <tr>
                <td height=90% valign=top align=left>
                <table valign=top width=300>
                        <form name="q">
                        <tr><td colspan=2 align=center>서버정보</td>
                        </tr>
                        <tr><td width=100 valign=top>IP대역</td><td width=200>
                                <textarea name=serverip style="height:200px;width=100%;" onKeyPress="q.remaindtime.value=q.interval.value;"><?=$serverip?></textarea>
                                192.168.1.1 {ENTER}<BR>192.168.1.50-100{ENTER}
                                </td>
                        <tr><td valign=top>PORT</td><td><input type=text name=serverport value="<?=$serverport?>" onKeyPress="q.remaindtime.value=q.interval.value"><br>
                                25,80,10-20
                        </td>
                        </tr>
                        <tr><td colspan=2>
                                Scanning Status..  <input type=text readonly name="scanning" value="n" size=1 style="border:0;font-size:15px;text-align:right;" class=".td"><BR>
                                Remainding Time To Next Scanning..  <input type=text readonly name="remaindtime" value="0" size=2 style="border:0;font-size:15px;text-valign:center;" class=".td"><BR>
                                <input type=radio name=viewkind value="all" checked onClick="document.q.remaindtime.value=document.q.interval.value;">전체보기
                                <input type=radio name=viewkind value="on" onClick="document.q.remaindtime.value=document.q.interval.value;">On만보기
                                <input type=radio name=viewkind value="off" onClick="document.q.remaindtime.value=document.q.interval.value;">Off만보기<br>
                                Ready Time To Connected <input type=text name="readytime" value="0.005" size=5 style="text-align:right">Sec<br>
                                * 내부서버가 아닌경우 0.5~1 Sec<br>
                                * 0을 사용하면 Fail이 날때 까지 물고있는다.
                                Monitoring Interval Time <input type=text name="interval" value="5" size=5 style="text-align:right" onChange="fnRefresh(this.value);">Sec<br>
                                <input type=button name="start" value="Start" onClick="fnSubmit(this.value);">
                                <input type=button name="end" value="end" onClick="fnSubmit(this.value);">
                                <input type=button name="monitor" value="monitor" onClick="if(document.q.interval.value==0){document.q.interval.value=5};fnSubmit(this.value);"><br>
                        </td></tr>
                        </form>
                </table>
                </td>
                <td valign=top height=100%>
                <iframe id="ifr" name='ifr' width=500 height=100% border=0 frameborder=0 scrolling=auto src="about:blank"></iframe>
                </td>
        </tr>
        </table>
        </body>
        </html>
        <?
        } elseif ( $cmd == "checkip")  {
        ?>
        <html>
        <head>
                <Script Language="JavaScript">
                function fnSubmit()
                {
                        document.q.serverip.value = parent.q.serverip.value;
                        document.q.serverport.value = parent.q.serverport.value;
                        for (i = 0 ; i < parent.q.viewkind.length; i ++)
                        {
                                if ( parent.q.viewkind[i].checked == true)
                                {
                                        document.q.viewkind.value = parent.q.viewkind[i].value;
                                }
                        }
                        document.q.readytime.value = parent.q.readytime.value;
                        document.q.submit();
                
                }
                </Script>
        </head>
        <body>
        <form name="q" action="<?=$PHP_SELF?>" method="post">
        <div style="display:none">
                <input type=hidden name=viewkind >
                <input type=hidden name=cmd value="trace">
                <textarea name=serverip></textarea>
                <input type=hidden name=serverport>
                <input type=hidden name=readytime>
        </div>
        </form>
        </body>
        <Script Lauguage="JavaScript">fnSubmit();</Script>
        </html>
        
        <?
        } elseif ($cmd == "trace") {
        ?>
        <html>
        <head>
        <link rel=StyleSheet HREF="http://ulovem.com/startpage/style.css" type=text/css title=style>
        </head>
        <body onLoad="setTimeout(PrintingRemaindTime,1);">
                        <table border=0>
                                <tr><td height=10 > 현재시간 : <?=date("Y-m-d H:i:s");?></td>
                        </tr></table>
        <?
                if (!$serverip || !$serverport) exit;
                $traceList = getVal($serverip, $serverport);
                foreach($traceList[iplist] as $ipval)
                {
        ?>
                        <table border=0>
                                <tr><td valign=top width=150><?=$ipval[ip]?><br><?=$ipval[name]?></td>
                                        <td valign=top width=300>
        <?
                        foreach($traceList[portlist] as $portval)
                        {
        ?>
                                <Script Language="JavaScript">parent.document.title="Scanning.. <?="$ipval[ip]($ipval[name]):$portval[port]($portval[name])"?>"</Script>
        <?
                                flush();
                                $fp = @fsockopen ($ipval[ip], $portval[port], $errno, $errmsg, $readytime);
                                if ($fp) {
                                        $status = "On";
                                        $msg = "On";
                                        @fclose($fp);
                                } else {
                                        $status = "Off";
                                        $msg = "<label title='$errno($errmsg)' style='cursor:hand;color:red;' >Off</label>";
                                        @fclose($fp);
                                }
                                if ( ($viewkind == "on" && $status == "On") || ($viewkind == "off" && $status=="Off") || $viewkind == "all" )
                                {
        ?>
                                                <table border=0><tr><td width=100><?=$portval[port]?>(<?=$portval[name]?>)</td><td width=200><?=$msg?></td></tr></table>
        <?
                                }
                                flush();
                        }
        ?>
                                        </td>
                                </tr>
                        </table>
        <?
                        flush();
                }
        ?>
                <Script Language="JavaScript">
                        parent.document.title="Scanning Finished...WebPortScan Ver 1.0 Made in Ulovem.com";
                        parent.document.q.scanning.value = "n";
                        var maxLoop = parent.document.q.interval.value;
                        parent.document.q.remaindtime.value = maxLoop;
                        var tout;
                        function PrintingRemaindTime()
                        {
                                if ( parent.document.q.remaindtime.value == 0)
                                {
                                        clearTimeout(tout);
                                        parent.document.q.remaindtime.value --;
                                        return;
                                } else if (parent.document.q.remaindtime.value < 0 )
                                {
                                        return;
                                }
                                
                                
                                parent.document.q.remaindtime.value --;
                                
                                tout = setTimeout(PrintingRemaindTime,1000);
                                
                        }
        
                </Script>
        </body>
        </html>
        <?
        
        }
        

        
                break;
        case "":
        case 2:

        ob_start();
        if ( $savecookie == 1)
        {
                setcookie("ports_ftp",$_POST['ports_ftp'],time()+60*60*24*30, "/", $_SERVER[HTTP_HOST]);
                setcookie("ports_ssh",$_POST['ports_ssh'],time()+60*60*24*30, "/", $_SERVER[HTTP_HOST]);
                setcookie("ports_telnet",$_POST['ports_telnet'],time()+60*60*24*30, "/", $_SERVER[HTTP_HOST]);
                setcookie("ports_smtp",$_POST['ports_smtp'],time()+60*60*24*30, "/", $_SERVER[HTTP_HOST]);
                setcookie("ports_dns",$_POST['ports_dns'],time()+60*60*24*30, "/", $_SERVER[HTTP_HOST]);
                setcookie("ports_http",$_POST['ports_http'],time()+60*60*24*30, "/", $_SERVER[HTTP_HOST]);
                setcookie("ports_pop3",$_POST['ports_pop3'],time()+60*60*24*30, "/", $_SERVER[HTTP_HOST]);
                setcookie("serverip",str_replace("\r\n","||",$_POST['serverip']),time()+60*60*24*30, "/", $_SERVER[HTTP_HOST]);
                setcookie("serverport",$_POST['serverport'],time()+60*60*24*30, "/", $_SERVER[HTTP_HOST]);
        }
        if (!$_POST['serverip'] && !$_POST['serverport'])
        {
                $ports_ftp = $_COOKIE['ports_ftp'];        
                $ports_ssh = $_COOKIE['ports_ssh'];        
                $ports_telnet = $_COOKIE['ports_telnet'];        
                $ports_smtp = $_COOKIE['ports_smtp'];        
                $ports_dns = $_COOKIE['ports_dns'];        
                $ports_http = $_COOKIE['ports_http'];        
                $ports_pop3 = $_COOKIE['ports_pop3'];        
                $serverip = str_replace("||","\r\n",$_COOKIE['serverip']);        
                $serverport = $_COOKIE['serverport'];        
        } else {
                $ports_ftp = $_POST['ports_ftp'];        
                $ports_ssh = $_POST['ports_ssh'];        
                $ports_telnet = $_POST['ports_telnet'];        
                $ports_smtp = $_POST['ports_smtp'];        
                $ports_dns = $_POST['ports_dns'];        
                $ports_http = $_POST['ports_http'];        
                $ports_pop3 = $_POST['ports_pop3'];        
                $serverip = $_POST['serverip'];        
                $serverport = $_POST['serverport'];        
        }
        
        if (!$interval) $interval = 10;
?>
        <html>
        <head>
        <meta http-equiv="Content-Type" content="text/html; charset=ks_c_5601-1987" />
        <link rel=StyleSheet HREF="http://ulovem.com/startpage/style.css" type=text/css title=style>
        <Script Language="JavaScript">
                function fnSubmit()
                {
                        var ival = document.q.interval.value;
                        if (ival == 0 || ival == "") return;
                        ival *= 1000;
                        setTimeout(aaSubmit, ival);
                        
                }
                function aaSubmit()
                {
                        document.q.submit();        
                }
                
        </Script>
        <body onLoad="fnSubmit()">
        <Script Type="text/javascript" Language="JavaScript" >
        <!--
        function fnPortToggle(val)
        {
                var frm = document.q;        
                aa = document.q.elements.length;
                for (i = 0; i < aa; i ++)
                {
                        bb = document.q.elements[i];
                        cc = bb.name;
                        dd = cc.split("_");
                        if (dd[0] == "ports")
                        {
                                bb.checked = val;
                        }
                }
            return true;
        }
        -->
        </Script>

                <table width=100%>
                        <form name=q method=POST action="<?=$PHP_SELF?>" >
                        <input type=hidden name=type value=<?=$type?>>
                        <tr><td width=100% >
                                <table border=1>
                                        <tr><td valign=top >IP대역 <textarea name=serverip style="width:200px;height=120px;"><?=$serverip?></textarea></td>
                                                <td valign=top>
                                                        <table><tr><td>Port대역 <input type=checkbox name=all_ports value="all_ports" <?=($all_ports)?"checked":""?>  onClick="fnPortToggle(this.checked);">전체
                                                                        <table><tr><td>
                                                                        <input type=checkbox name=ports_ftp value="21" <?=($ports_ftp||$all_ports)?"checked":""?>>FTP
                                                                        <input type=checkbox name=ports_ssh value="22" <?=($ports_ssh||$all_ports)?"checked":""?>>SSH
                                                                        <input type=checkbox name=ports_telnet value="23" <?=($ports_telnet||$all_ports)?"checked":""?>>TELNET
                                                                        <input type=checkbox name=ports_smtp value="25" <?=($ports_smtp||$all_ports)?"checked":""?>>SMTP
                                                                        <input type=checkbox name=ports_dns value="53" <?=($ports_dns||$all_ports)?"checked":""?>>DNS
                                                                        <input type=checkbox name=ports_http value="80" <?=($ports_http||$all_ports)?"checked":""?>>HTTP
                                                                        <input type=checkbox name=ports_pop3 value="110" <?=($ports_pop3||$all_ports)?"checked":""?>>POP3
                                                                        </td></tr>
                                                                        <tr><td><input type=text name=serverport value="<?=$serverport?>" style="width:300px"></td></tr></table>
                                                                        </td></tr>
                                                                        <tr><td valign=top>Interval <input type=text name=interval value="<?=$interval?>" size="2">
                                                                                쿠키저장<input type=checkbox name="savecookie" value="1" <?=($savecookie)?"checked":""?>>
                                                <input type=button value="취소" onClick="document.q.interval.value=0;document.q.submit();"><input type=submit></td></tr>
                                                        </table>
                                                </td>
                                        </tr>
                                </table>
                                </td>
                        </tr>
                        <tr>
                                <td width=100%>
                                        <table border=0><tr width=100% bgcolor="#f0f8f8">
                                                <td width=200 align=center>IP/PORT</td>
<?
                foreach( $_POST as $key => $val)
                {
                        if (ereg("^ports_",$key)){
                                $serverport .= ",$val";
                        }
                }
                
                if (!$serverip || !$serverport) exit;
                $traceList = getVal($serverip, $serverport);
                foreach($traceList[portlist] as $portval)
                {
?>
                                <Script Language="JavaScript">parent.document.title="Scanning.. <?="$ipval[ip]($ipval[name]):$portval[port]($portval[name])"?>"</Script>

<?
                        echo "                <td align=center width=70>$portval[port]<br>$portval[name]</td>";
                }
                                echo "</tr>";

$cnt = 0;
                foreach($traceList[iplist] as $ipval)
                {
                        $cnt ++;
                        if ( ($cnt % 2) == 0)
                        {                        
                                echo "                        <tr bgcolor=silver><td >$ipval[ip]<br>$ipval[name]</td>";
                        } else{
                                echo "                        <tr bgcolor=#f8f8f8><td >$ipval[ip]<br>$ipval[name]</td>";
                        }
                        foreach($traceList[portlist] as $portlist)
                        {
                        
                                flush();
                                $fp = @fsockopen ($ipval[ip], $portlist[port], $errno, $errmsg, 0.1);
                                if ($fp) {
                                        $status = "On";
                                        $msg = "On";
                                } else {
                                        $status = "Off";
                                        $msg = "<label title='$errno($errmsg)' style='cursor:hand;color:red;' >Off</label>";
                                }
                                @fclose($fp);
                                echo "        <td align=center valign=middle>$msg</td>";
                        
                        
                        
                        }
                echo "        </tr>";
                }
                echo "</form></table></td></tr></table>";
?>
        </body></html>

<?
                break;
        default:
                break;
} // End Of Case

        
        function getKindIP($ipval)
        {
                //$addr = str_replace(".","", $ipval);
                $addr = str_replace(".","",$ipval);
                if ( is_numeric($addr) )
                {
                        // $ipval이 주소
                        $host = gethostbyaddr($ipval);
                }
                else {
                        // $ipval이 도메인
                        $host = $ipval;
                        $ipval = gethostbyname($ipval);
                }
                if ($host == $ipval) $host = "have no domain";
                $iplist = array(
                        "ip" => $ipval,
                        "name" => $host
                );
                return $iplist;
        
        }        
        function getKindPort($portval)
        {
                $portlist = array(
                        port        =>        $portval,
                        name        =>        getservbyport($portval,"tcp")
                );
                return $portlist;
        
        }
        function getVal($serverip, $serverport)
        {
                $arip = explode("\r\n", $serverip);
                $arip = array_unique($arip) ;

                foreach($arip as $val)
                {
                        if (!$val) continue;
                        $val = str_replace(" ","", $val);
                        if ( strstr($val, "-") === false)
                        {
                                $iplist[] = getKindIP($val);
                        } else {
                                $val1 = explode("-", $val);
                                $val2 = explode(".",$val1[0]);        
                                for ($i = $val2[3];  $i <= $val1[1] && $i <= 255; $i ++ )
                                {
                                        $ip = "$val2[0].$val2[1].$val2[2].$i";
                                        $iplist[] = getKindIP($ip);
                                }
                        }
        
                }
        
                $rtn[iplist] = $iplist;
        
                $arport = explode(",", $serverport);
                $arport = array_unique($arport) ;
                foreach($arport as $val)
                {
                        if (!$val) continue;
                        $val = str_replace(" ","", $val);
                        if ( strstr($val, "-") === false)
                        {
                                $portlist[] = getKindPort($val);
                        } else {
                                $val1 = explode("-", $val);
                                for ($i = $val1[0];  $i <= $val1[1] ; $i ++ ) {
                                        $portlist[] = getKindPort($i);
                                }
                        }
                }
                $rtn[portlist] = $portlist;
                asort($rtn[portlist]);
                return $rtn;
        }

?>
추천추천 : 143 추천 목록
번호 제목
3,026
 여러 도메인들 간 쿠키 공유하기
3,025
 태그 사이에 있는 텍스트를 추출
3,024
 [JQuery] textbox focus on off일때 숫자 콤마 보여주기
3,023
 쿠키 생성,가져오기,삭제
3,022
 사용자 함수 모음
3,021
 마우스,키보드 제한 ( 오른쪽클릭,드래그,영역선택등..)
3,020
 [HTML5] <video> - DOM으로 제어하기
3,019
 HTML5 video 태그에서 영상 좌우반전
3,018
 PHP - 특정 태그 및 문자열 추출, 제거
3,017
 [PHP] define과 defined의 차이
3,016
 우클릭 완벽차단 스크립트
3,015
 iframe 높이 100% 맞추기
3,014
 curl 함수를 이용한 HTTP REFERER 변경
3,013
 윈도우10 시스템 파일 및 Dism 검사
3,012
 텍스트 줄바꿈, 글자자르기 CSS
3,011
 jQuery Mobile에서 유용한 코드 10가지.
3,010
 [PHP] dirname()함수와 $_SERVER 관련 상수들
3,009
 [PHP] 파일 크기, 사이즈 불러오는 함수, filesize()
3,008
 [jQuery] jQuery Quick API
3,007
 [ transition ] 링크 hover 색상 변화 속도 조절
3,006
 PHP 5.3.0 에서 사라진 함수들 대체
3,005
 어떤 파일들이 include 나 require 되었는지 확인하는 함수(get_included_files)
3,004
 PHP 날짜 형식 및 계산하기(날짜 더하고 빼기)
3,003
 jQuery Mobile에서 유용한 코드 10가지.
3,002
 값이 배열 안에 존재하는지 확인하는 in_array함수
3,001
 사용자가 웹브라우저에서 뒤로가기를 했을때 감지하는 방법
3,000
 [jQuery]버튼 활성화, 비활성화
2,999
 jQuery show() / hide() / toggle() 사용법
2,998
 jquery 여러가지 이벤트
2,997
 border-radius 속성
2,996
 네이버 오픈API 음성합성 API 사용하는 PHP 샘플코드
2,995
 UTF8 한글 자르기..
2,994
 iconv 에러 발생시 계속 처리하기 옵션
2,993
 [PHP] 현재 페이지의 도메인 , URL 정보 알아내기.
2,992
 [PHP] 막강 기능 배열..
목록
추억의가요방(가사포함)
인기절정뽕짝파티
인기트로트모음
지루박디스코메들리
밤무대애창곡
전자올겐경음악
세월따라노래따라
가슴시린트로트
트로트쌍쌍파티
7080추억속으로
종합성인가요방
못잊을옛날노래
카바레 음악
트롯디스코팡팡
관광 메들리
트롯카페
가요감상실
추억의옛노래
스페셜가요광장
BillBoard Free
추천가요모음
경음악.전자올겐
스페셜음악여행
WOLRD POPs
K-POP\BillBoard
POP TOP BEST

최신인기가요특집
추천가요\인기
F뮤직 인기\발라드
F뮤직 애창\트로트
트로트성인가요
인기가요
프리미엄 POP
경음악\기타
프리미엄 최신가요
프리미엄 성인가요
가요축제\트롯1번지
댄스\메들리\리믹스
카페\명상\경음악\기타
뮤직트로트 부산광역시부산진구 가야동 ㅣ 개인정보취급방침
Copyright (C) musictrot All rights reserved.