웹에서 exec 계열소스를 사용하였는지, 내용검색 기반으로 검색하는 쉘스크립트를 작성해보았다.
조금만 응용하면 Code 단에서 Injection 먹히는 부분을 빠르게 점검할 수 있다.
#vi findExecve.sh (쉘스크립트 삭성을 하여 일괄 처리)
#!/bin/bash echo "START" grep -r -n "system(" ./ | awk -F : '{print "filename : "$1"\nline: "$2"\nmatch: "$3"\n\n"}' > result.txt grep -r -n "execl(" ./ | awk -F : '{print "filename : "$1"\nline: "$2"\nmatch: "$3"\n\n"}' >> result.txt grep -r -n "execve(" ./ | awk -F : '{print "filename : "$1"\nline: "$2"\nmatch: "$3"\n\n"}' >> result.txt grep -r -n "fopen(" ./ | awk -F : '{print "filename : "$1"\nline: "$2"\nmatch: "$3"\n\n"}' >> result.txt grep -r -n "passthru(" ./ | awk -F : '{print "filename : "$1"\nline: "$2"\nmatch: "$3"\n\n"}' >> result.txt grep -r -n "exec" ./ | awk -F : '{print "filename : "$1"\nline: "$2"\nmatch: "$3"\n\n"}' >> result.txt grep -r -n "shell_exec(" ./ | awk -F : '{print "filename : "$1"\nline: "$2"\nmatch: "$3"\n\n"}' >> result.txt echo "create file \"result.txt\"" echo "FINISH" |
'Web_Hacking' 카테고리의 다른 글
SQLMAP sql injectionor (0) | 2015.03.03 |
---|---|
php mail function php injection (0) | 2014.11.08 |
[white hacking] 화이트 해킹대회 web PPPPAAAASSSWWW... (150Point) (0) | 2013.09.15 |
[White Hacking] Serial2 web(150 point) Write-up (0) | 2013.09.15 |
블라인드 인젝터 미리 코딩... (0) | 2013.06.10 |