2012년 8월 9일 목요일

tmp 해킹툴 삭제 스크립트

서버의 트래픽이 갑자기  100M이상 늘어나는 현상이 있었다.

서버체크를 해보니 /tmp 디렉토리에 숨김파일로 공격툴이 심어져 있고,

다른 쪽으로 공격을 하고 있었다.

일단 해당 프로세스를 죽인후 해당 파일을 삭제처리 하였다.

tmp 해킹에 대해서 검색하여, tmp 디렉토에서는 실행할  수 없게끔 설정하였다.

문제는 /tmp/.hack 이렇게 경로로 실행을 하면 실행 되지 않지만,

sh /tmp/.hack 이런 식으로 주면 실행이 가능하다.

해당 공격툴의 소유자가 nobody 인 걸로 봐서 웹을 통한 해킹인 것으로 보이는 데,

해당 문제는 다른 이유로 만질 수 있는 상태가 아니다.

tmpwatch를 이용해서 /tmp 디렉토리에서 해킹툴을 지속적으로 삭제해주도록 걸어 놨다.

몇일 간 문제가 없어 보였으나 ,  다시 트래픽이 쳐서 확인 해 보았다.

공격툴이 정상적으로 삭제 되어졌으나 문제는 메모리에 이미 로드 되어 실행이 되고 있는 상태인 것 같다.

프로세스를 확인 하면 [sh] <defunct> 이렇게 나오는 부분이 있는 데, 역시나 삭제된 해킹툴이다.

해서 /tmp 디렉토리에서 실행되는 프로그램은 죽여버리고, 삭제 시키는 스크립트를 만들었다.

----------------
#/bin/shwhile (( 1 ))do        for f in `find /tmp/ -type f | grep -v "sess_*"`        do                if [ "$f" != "." ] && [ "$f" != ".." ] && [ "$f" != ".ICE-unix" ] && [ "$f" != ".font-unix" ]                then                        if [ -e $f ]                        then                                #echo $f' is file'                                lsof $f | sed '1d' | awk '{print $2}' | xargs kill -9                                rm -rf $f                        fi                fi        done        sleep 5done

해당 프로그램을 실행하면 5초 마다 실행 되도록 작성 해 놓았다.

부하는 그리 크지 않는 듯 하나, 루프를 돌리기 싫다면, while 부분을 삭제하고 크론으로 등록하여 사용해도 좋을 듯하다.

윈도우 2008에서 Windows Defender 설치

윈도우 서버의 기본 보안 프로그램인 Windows Defender를 설치해서 사용할 수 있다.

윈도우2008부터는 Windows Defender가 기본으로 제공되므로 따로 설치할 필요가 없다.

근데 어디에서도 Windows Defender를 찾을 수가 없다.

따로 설치 파일을 받아서 설치하려고 해도 이미 설치되어 있다고 하며 설치가 안된다.

서버관리자에서 기능추가에서 데스크탑 경험을 설치하면 된다.

 

http://linhost.info/2009/05/ask-the-admin-how-do-i-install-windows-defender-on-windows-server-2008/

logparser를 이용한 mssql sa 공격 차단하기

sqler.com에서 '이벤트 뷰어 sa 로그인 시도 ip차단 시키는 방법.'를 보고 만들었다.

sqler.com에 있는 배치파일이 제대로 작동 되면 그냥 썼으면 좋았으련만...

이것저것 다 적용하려고 하니 너무 방대해 지는 것 같아서 그냥 사용하려고 한다.

logparser가 기본적으로 깔려있어야 실행 된다.

안에 내용물은 배치파일 3개, sql문 1개인데

배치파일은 그냥 만들던거 집어넣은 거고, v3버젼을 사용하면 된다.

sql파일은 mssql 사용포트를 자동으로 가져오려고 하다보니 집어 넣게 됬다.

sa_attack_deny
@echo offREM @echo onREM @echo off 화면에 출력되지 않게 함CLSREM #########################REM blog.netchk.comREM #########################REM 자동으로 체크 하도록 변경.REM #############################################설정정보REM sql 사용 포트REM SET sql_port=1433REM logParser 경로. \를 붙여서 넣어야 함REM SET logParser="%ProgramFiles%\Log Parser 2.2\LogParser.exe"REM os 버젼 2003 이면 1, 2008이면 2REM SET os_version=2003REM #############################################:startREM ################################# 언어 확인 STARTset Key="HKEY_CURRENT_USER\Control Panel\International"for /F "tokens=3" %%a in ('reg query %Key%  ^| find /i "sLang"') do set os_lang=%%aREM echo Language is %os_lang%REM KOR 이라고 나옴.IF /I %os_lang% == KOR (SET findName=이름SET query_type=클라이언트:) else (SET findName=NameSET query_type=client:)REM ################################# 언어 확인 ENDREM ################################# sql port 확인 STARTIF NOT EXIST PORT.sql (	echo port.sql 파일이 없습니다.	ECHO mssql 포트 번호를 확인 할 수 없습니다.	GOTO exit)for /f "tokens=3 delims=:" %%i in ('sqlcmd -S . -i PORT.sql') do set sql_port=%%iREM echo %sql_port%REM ################################# sql port 확인 ENDREM ################################# 32,64bit 확인하고 programFiles 위치 체크 STARTif "%ProgramFiles(x86)%XXX"=="XXX" (REM echo 32-bitset flatform=32set ProgRoot="%ProgramFiles%") else (set ProgRoot="%ProgramFiles(x86)%"set flatform=64)for /f "delims=" %%a in (%ProgRoot%) do set ProgRoot=%%~aREM echo %ProgRoot%set logParser="%ProgRoot%\Log Parser 2.2\LogParser.exe"REM ################################# 32,64bit 확인하고 programFiles 위치 체크 ENDREM #################################  log parser 확인 STARTECHO.echo log parser 가 설치되었는지 확인합니다.if not exist %logParser% (	echo logParser가 설치되어 있지 않거나 경로가 틀립니다.	echo Log Parser 설정된 경로 : %logParser%	echo http://www.microsoft.com/en-us/download/details.aspx?id=24659	pause	goto exit) else (	echo 설치확인.)REM #################################  log parser 확인 ENDECHO.echo wevtutil 프로그램이 있는 지 확인합니다.if exist %SystemRoot%\system32\wevtutil.exe (	echo wevtutil 확인.) else (	echo 이벤트 로그를 삭제 하기 위해서는 wevtutil 이 필요합니다.	echo 이벤트 로그를 삭제 하지 않고 진행합니다.	timeout /t 2 /nobreak)echo system 확인 결과 입니다.echo OS Language : %os_lang%REM echo OS version  : %os_version%echo OS platform : %flatform%echo mssql port  : %sql_port%:start_ip_sececho ---------------------------에러 메시지 설명 ------------------------------echo 1. ... 필터 목록이 이미 있습니다.라는 메시지는 정상입니다.echo.echo 2. 파일 temp.txt을(를) 찾을 수 없습니다. 라는 메시지는echo    새로운 공격로그가 없을 경우 나타납니다.echo.echo 3. 이름이 '3'인 규칙이 정책 ...생략... 이미 있습니다. 메시지 역시 정상입니다.echo --------------------------------------------------------------------------------echo.timeout /t 5 /nobreakECHO.REM 차단 시작echo.echo 아이피 차단을를 진행합니다.echo.echo.REM 로컬룰지정netsh ipsec static set store location=localREM 최초 룰정책 생성netsh ipsec static add policy name=sql_sa_attack_ip_deny_list description="이벤트로그를 이용한 sa 공격시도 아이피 차단--blog.netchk.com NDH" assign=yesREM 필터리스트 추가netsh ipsec static add filterlist name=ip_denynetsh ipsec static add filterlist name=LocalREM 허용/거부룰 설정netsh ipsec static add filteraction name=Permit action=Permitnetsh ipsec static add filteraction name=Block action=Blockecho.echo.REM 이벤트로그 중 sql sa 계정 공격 아이피만 가져오는 쿼리. temp.txt로 생성REM %logParser% -i:evt -o:nat -q:on "SELECT DISTINCT TRIM(EXTRACT_TOKEN(EXTRACT_TOKEN(Strings,1,'%query_type%'),0,']')) AS ip INTO temp.txt  FROM application WHERE EventID='18456' AND Strings LIKE '%%sa%%'"REM temp.txt 저장된 정보를 라인단위로 읽어 'ip_deny' 이름으로 작성된 netsh ipsec에 등록하기 위해 event_netsh ipsec_deny.bat 파일로 만든다 or 실행.REM /f 옵션 : 파일을 읽어드림REM bat 파일로 만듬REM for /f  %%i in (temp.txt) do @echo netsh ipsec static add filter filterlist="ip_deny" srcaddr=%%i dstaddr=me description="SQL SA접속시도 자동차단 : %date% %time% 등록" protocol=tcp srcport=0 dstport=%sql_port%>>reg_netsh ipsec_deny.batREM 바로 실행for /f  %%i in (temp.txt) do netsh ipsec static add filter filterlist="ip_deny" srcaddr=%%i dstaddr=me description="SQL SA접속시도 자동차단 : %date% %time% 등록" protocol=tcp srcport=0 dstport=%sql_port%REM temp.txt 삭제del /q temp.txtecho.echo.REM 로컬트래픽허용netsh ipsec static add filter filterlist=Local srcaddr=me dstaddr=localhost dstmask=255.255.255.0 protocol=ANY mirrored=yesREM 필터룰 추가netsh ipsec static add rule name=3 policy=sql_sa_attack_ip_deny_list filter=ip_deny filteraction=Blocknetsh ipsec static add rule name=1 policy=sql_sa_attack_ip_deny_list filter=Local filteraction=PermitREM 차단 끝:del_app_evtREM wevtutil 있어야 함.이벤트로그 삭제REM wevtutil cl application pausegoto exit:exitCLSecho 프로그램을 종료합니다.pause

ps.만든지  일주일 정도 지났는 데, 파워쉘로 더 간단하고 logparser 설치 할 필요도 없이 만들 수 있다는 걸 알게 됬다..;

2012년 7월 25일 수요일

2012년 7월 14일 토요일

ORA-00845: MEMORY_TARGET not supported on this system

vi

tmpfs                   /dev/shm                tmpfs   defaults,size=4g        0 0

 

 

 

 

 

 

출처:http://h391106.tistory.com/243

2012년 7월 5일 목요일

vnc 접속시 빈화면 나오는 현상

 

 

결론 부터 말하면 gnome 이나 kde 가 설치 되지 않아서 이다.

centos 를 한글로 설치하면
yum grouplist를 치면 아래 처럼 한글로 나온다.

groupinstall도 역시 한글로 입력해야 제대로 설치가 된다.


yum groupinstall '데스크탑' << gnome 설치


[root@localhost .vnc]# yum grouplistLoaded plugins: fastestmirrorSetting up Group ProcessLoading mirror speeds from cached hostfile * base: data.nicehosting.co.kr * extras: data.nicehosting.co.kr * updates: data.nicehosting.co.krInstalled Groups:   NFS 파일 서버   Perl 지원   X Window 시스템   거대 시스템 성능   과학기술 지원   그래픽기반 관리 도구   기본   네트워크 파일 시스템 클라이언트   네트워킹 도구   데스크탑 플랫폼   디렉터리 클라이언트   디버깅 도구   레거시 X Windows 시스템 호환성   레거시 유닉스 호환성   범용 데스크탑   서버 플랫폼   성능 도구   원격 데스크탑 클라이언트   웹 서블렛 엔진   이메일 서버   자바 플랫폼   추가 개발   콘솔 인터넷 도구   폰트   하드웨어 모니터링 도구Installed Language Groups:   라오어 지원 [lo]   아랍어 지원 [ar]   아르메니아어 지원 [hy]   이누이트어 지원 [iu]   일본어 지원 [ja]   조지아어 지원 [ka]   타지크어 지원 [tg]   한국어 지원 [ko]   히브리어 지원 [he]Available Groups:   CIFS 파일 서버   Eclipse   FCoE 저장소 클라이언트   FTP 서버   Identity Management Server   Infiniband 지원   KDE 데스크탑   MySQL 데이터베이스 서버   MySQL 데이터베이스 클라이언트   PHP 지원   PostgreSQL 데이터베이스 서버   PostgreSQL 데이터베이스 클라이언트   Ruby Support   SNMP 지원   TeX 지원   TurboGears 어플리케이션 프레임워크   iSCSI 저장소 클라이언트   가상화   가상화 도구   가상화 클라이언트   가상화 플랫폼   개발용 도구   고가용성   고가용성 관리   그래픽 생성 도구   기술 저작   내결함성 스토리지   네트워크 인프라스트럭쳐 서버   네트워크 저장소 서버   데스크탑   데스크탑 디버깅과 성능 도구   데스크탑 플랫폼 개발   디렉터리 서버   로드 밸런싱   메시지 클라이언트 지원   메인프레임 억세스   백업 서버   백업 클라이언트   보안 도구   서버 플랫폼 개발   소말리아어 지원   스마트카드 지원   시스템 관리   시스템 관리 도구   시스템 관리 메세지 서버 지원   오피스 스위트/생산성   웹 서버   웹기반 엔터프라이즈 관리   이맥스   인쇄 서버   인쇄 클라이언트   인터넷 브라우저   인터넷 프로그램   입력 방식   저장소 가용성 도구   전화연결 네트워킹 지원   클라이언트 관리 도구   호환성 라이브러리Available Language Groups:   Xhosa 지원 [xh]   갈리시아어 지원 [gl]   게일어 지원 [gd]   고지 소르비아어 지원 [hsb]   구자라티어 지원 [gu]   그리스어 지원 [el]   네델란드어 지원 [nl]   네팔어 지원 [ne]   노르웨이어 지원 [nb]   덴마크어 지원 [da]   독일어 지원 [de]   라트비아어 지원 [lv]   라틴어 지원 [la]   러시아어 지원 [ru]   루마니아어 지원 [ro]   룩셈부르크어 지원 [lb]   르완다어 지원 [rw]   리투아니아어 지원 [lt]   마라티어 지원 [mr]   마오리어 지원 [mi]   마이틸리어 지원 [mai]   마케도니아어 지원 [mk]   말라가시어 지원 [mg]   말라얄람어 지원 [ml]   말레이어 지원 [ms]   맹크스어 지원 [gv]   몰타어 지원 [mt]   몽골어 지원 [mn]   미얀마어(버마어) 지원 [my]   바스크어 지원 [eu]   베트남어 지원 [vi]   벤다어 지원 [ve]   벨로루시어 지원 [be]   벵골어 지원 [bn]   부탄어 지원 [dz]   불가리아어 지원 [bg]   브라질 포르투갈어 지원 [pt_BR]   브르타뉴어 지원 [br]   사르데냐어 지원 [sc]   산스크리트어 지원 [sa]   세르비아어 지원 [sr]   소토어(남) 지원 [st]   소토어(북) 지원 [nso]   스와티어 지원 [ss]   스와힐리어 지원 [sw]   스웨덴어 지원 [sv]   스페인어 지원 [es]   슬로바키아어 지원 [sk]   슬로베이아어 지원 [sl]   신드어 지원 [sd]   신할라어 지원 [si]   아마지그어 지원 [ber]   아삼어 지원 [as]   아이슬란드어 지원 [is]   아일랜드어 지원 [ga]   아제르바이잔어 지원 [az]   아프리칸스어 지원 [af]   알바니아어 지원 [sq]   에스토니아어 지원 [et]   에스페란토어 지원 [eo]   에티오피아어 지원 [am]   영어(영국) 지원 [en_GB]   오리야어 지원 [or]   오크어 지원 [oc]   왈론어 지원 [wa]   우르두어 지원 [ur]   우즈벡어 지원 [uz]   우크라이나어 지원 [uk]   웨일즈어 지원 [cy]   은데벨레어(남) 지원 [nr]   이탈리아어 지원 [it]   인도네시아어 지원 [id]   인테르링구아 지원 [ia]   저지 섹슨어 지원 [nds]   줄루어 지원 [zu]   중국어 지원 [zh]   차티스가리어 지원 [hne]   체코어 지원 [cs]   총가어 지원 [ts]   츠와나어 지원 [tn]   치체와어 지원 [ny]   카슈미르어 지원 [ks]   카슈브어 지원 [csb]   카자흐어 지원 [kk]   카탈로니아어 지원 [ca]   칸나다어 지원 [kn]   콘칸어 지원 [kok]   콥틱어 지원 [cop]   쿠르드어 지원 [ku]   크로아티아어 지원 [hr]   크메르어 지원 [km]   타갈로그어 지원 [tl]   타밀어 지원 [ta]   태국어 지원 [th]   터키어 지원 [tr]   테툼어 지원 [tet]   텔루구어 지원 [te]   투르크멘어 지원 [tk]   티벳어 지원 [bo]   펀잡어 지원 [pa]   페로스어 지원 [fo]   페르시아어 지원 [fa]   포르투갈어 지원 [pt]   폴란드어 지원 [pl]   프랑스어 지원 [fr]   프리울리안어 지원 [fur]   프리지아어 지원 [fy]   피지어 지원 [fj]   핀란드어 지원 [fi]   필리핀어 지원 [fil]   헝가리아어 지원 [hu]   힌두어 지원 [hi]   힐리가이노어 지원 [hil]Done

 

 



 

 

 

2012년 7월 3일 화요일

asp vs php 비교

 

 













































































































































































ASP (VBScript)



PHP (v4.3+)


General syntax
ASP Comments, inline
'my dog has fleas
PHP Comments, inline
//my dog has fleas
ASP Comments, block

not available?
PHP Comments, block
/*
The quick brown fox
jumped over the lazy dogs.
*/
ASP, Escaping quotes
"""var text1=""<img src=\""blank.gif\"">"";"

PHP, Escaping quotes
\" or use ' like javascript'var text1="<img src=\"blank.gif\">";';

ASP Command termination
None, but : can be used to separate commands
on the same line.
PHP Command termination
Each command must end with ; but
multiple commands per line are allowed.
ASP Screen output
response.write "hello"
PHP Screen output
echo "hello";
ASP Newline characters
vbCrLfresponse.write "hello" & vbCrLf

PHP Newline characters
"\n" (must be inside "", not '')echo "hello \n";

ASP Variable Names
Not case sensitive,
so fName is the same as FNAME
PHP Variable Names
Case sensitive AND must begin with $
so $fName is NOT the same as $FNAME
String Functions
ASP String concatenation
&fname=name1 & " " & name2
emsg=emsg & "error!"

PHP String concatenation
. and .=$fname=$name1." ".$name2;
$emsg.="error!";

ASP, Change case
LCase(), UCase()lowerName=LCase(chatName)
upperName=UCase(chatName)

PHP, Change case
strtolower(), strtoupper()$lowerName=strtolower($chatName);
$upperName=strtoupper($chatName);

ASP String length
Len()n=Len(chatName)

PHP String length
strlen()$n=strlen($chatName);

ASP, Trim whitespace
Trim()temp=Trim(xpage)

PHP, Trim whitespace
trim() and also ltrim(), rtrim()$temp=trim($xpage);

ASP String sections

Left(), Right(), Mid()Left("abcdef",3)      result = "abc"Right("abcdef",2)     result = "ef"Mid("abcdef",3)       result = "cdef"Mid("abcdef",2,4)     result = "bcde"

PHP String sections

substr()substr("abcdef",0,3);     result = "abc"substr("abcdef",-2);      result = "ef"substr("abcdef",2);       result = "cdef"substr("abcdef",1,4);     result = "bcde"

ASP String search forward, reverse

Instr(), InstrRev()x=Instr("abcdef","de")        x=4x=InstrRev("alabama","a")     x=7

PHP String search forward, reverse

strpos(), strrpos()$x=strpos("abcdef","de");      x=3$x=strrpos("alabama","a");     x=6

ASP String replace
Replace(string exp,search,replace)temp=Replace(temp,"orange","apple")
temp=Replace(temp,"'","\'")
temp=Replace(temp,"""","\""")

PHP String replace
str_replace(search,replace,string exp)$temp=str_replace("orange","apple",$temp); $temp=str_replace("'","\\'",$temp);
$temp=str_replace("\"","\\\"",$temp);

ASP, split a string into an array

Split()temp="cows,horses,chickens"farm=Split(temp,",",-1,1)x=farm(0)

PHP, split a string into an array

explode()$temp="cows,horses,chickens";$farm=explode(",",$temp);$x=$farm[0];

ASP, convert ASCII to String
x=Chr(65) x="A"
PHP, convert ASCII to String
$x=chr(65); x="A"
ASP, convert String to ASCII
x=Asc("A") x=65
PHP, convert String to ASCII
$x=ord("A") x=65
Control Structures
ASP, if statements

if x=100 then  x=x+5elseif x<200 then  x=x+2else  x=x+1end if

PHP, if statements

if ($x==100) {  $x=$x+5;}else if ($x<200) {  $x=$x+2;}else {  $x++;}

ASP, for loops

for x=0 to 100 step 2  if x>p then exit fornext

PHP, for loops

for ($x=0; $x<=100; $x+=2) {  if ($x>$p) {break;}}

ASP, while loops

do while x<100  x=x+1  if x>p then exit doloop

PHP, while loops

while ($x<100) {  $x++;  if ($x>$p) {break;}}

ASP, branching

select case chartName  case "TopSales"    theTitle="Best Sellers"    theClass="S"  case "TopSingles"    theTitle="Singles Chart"    theClass="S"  case "TopAlbums"    theTitle="Album Chart"    theClass="A"  case else    theTitle="Not Found"end select

PHP, branching

switch ($chartName) {  case "TopSales":    $theTitle="Best Sellers"; $theClass="S";    break;  case "TopSingles":    $theTitle="Singles Chart"; $theClass="S";    break;  case "TopAlbums":    $theTitle="Album Chart"; $theClass="A";    break;  default:    $theTitle="Not Found";}

ASP functions

Function myFunction(x)  myFunction = x*16  'Return valueEnd Function

PHP functions

function myFunction($x) {  return $x*16;  //Return value}

HTTP Environment
ASP, Server variables

Request.ServerVariables("SERVER_NAME")Request.ServerVariables("SCRIPT_NAME")Request.ServerVariables("HTTP_USER_AGENT")Request.ServerVariables("REMOTE_ADDR")Request.ServerVariables("HTTP_REFERER")

PHP, Server variables

$_SERVER["HTTP_HOST"];$_SERVER["PHP_SELF"];$_SERVER["HTTP_USER_AGENT"];$_SERVER["REMOTE_ADDR"];@$_SERVER["HTTP_REFERER"];     @ = ignore errors

ASP Page redirects
Response.redirect("wrong_link.htm")
PHP Page redirects
header("Location: wrong_link.htm");
ASP, GET and POST variables
Request.QueryString("chat")
Request.Form("username")
PHP, GET and POST variables
@$_GET["chat"];       @ = ignore errors
@$_POST["username"];
ASP, prevent page caching
Response.CacheControl="no-cache"
Response.AddHeader "pragma","no-cache"
PHP, prevent page caching
header("Cache-Control: no-store, no-cache");
header("Pragma: no-cache");
ASP, Limit script execution time, in seconds
Server.ScriptTimeout(240)
PHP, Limit script execution time, in seconds
set_time_limit(240);
ASP, Timing script execution

s_t=timer ...ASP script to be timed...duration=timer-s_tresponse.write duration &" seconds"

PHP, Timing script execution

$s_t=microtime();...PHP script to be timed...$duration=microtime_diff($s_t,microtime());$duration=sprintf("%0.3f",$duration);echo $duration." seconds";//required functionfunction microtime_diff($a,$b) {  list($a_dec,$a_sec)=explode(" ",$a);  list($b_dec,$b_sec)=explode(" ",$b);  return $b_sec-$a_sec+$b_dec-$a_dec;}

File System Functions
ASP, create a file system object (second line is wrapped)
'Required for all file system functions
fileObj=Server.CreateObject
("Scripting.FileSystemObject")
PHP, create a file system object
Not necessary in PHP
ASP, check if a file exists
pFile="data.txt"
fileObj.FileExists(Server.MapPath(pFile))
PHP, check if a file exists
$pFile="data.txt";
file_exists($pFile);
ASP, Read a text file

pFile="data.txt"xPage=fileObj.GetFile(Server.MapPath(pFile))xSize=xPage.Size  'Get size of file in bytesxPage=fileObj.OpenTextFile(Server.MapPath(pFile))temp=xPage.Read(xSize)  'Read filelinkPage.Close

PHP, Read a text file

$pFile="data.txt";$temp=file_get_contents($pFile);  //Read file

Time and Date Functions
ASP, Server Time or Date
Now, Date, Time
PHP, Server Time or Date
date()
ASP, Date format (default)
Now = 7/2/2012 4:21:51 AM
Date = 7/2/2012
Time = 4:21:51 AM
Various ASP functions extract date parts:

Month(Date) = 7
MonthName(Month(Date)) = July
Day(Date) = 2
WeekdayName(Weekday(Date)) = Monday
WeekdayName(Weekday(Date),False) = Mon

PHP, Date format
There is no default format in PHP.
The date() function is formatted using codes:
date("n/j/Y g:i:s A") = 7/2/2012 4:21:51 AM

date("n") = 7
date("F") = July
date("j") = 2
date("l") = Monday
date("D") = Mon

Numeric Functions
ASP, convert decimal to integer
Int()n=Int(x)

PHP, convert decimal to integer
floor()$n=floor($x);

ASP, determine if a value is numeric
IsNumeric()if IsNumeric(n) then ...

PHP, determine if a value is numeric
is_numeric()if (is_numeric($num)) {...}

ASP, modulus function
x mod y
PHP, modulus function
$x % $y

 

http://www.design215.com/toolbox/asp.php