본문 바로가기

script9

윈도우 환경 다운로드 실행파일 및 스크립트 실행 위험 보안 통제 윈도우 시스템에서 다운로드 폴더에 실행 파일(.exe), 스크립트 파일(.hta, .jse, .cmd 등)이 다운로드 되어 실행될 때 발생할 수 있는 보안 위협을 방지하기 위한 몇 가지 방법이 있습니다. 이러한 파일들은 악성 코드의 전형적인 전달 수단이 될 수 있으며, 사용자의 시스템에 백도어를 설치하는 등의 악용될 가능성이 높습니다. 여기에는 Software Restriction Policies (SRP)나 AppLocker와 같은 윈도우 내장 기능을 활용하는 방법과 기타 보안 관련 조치들이 포함됩니다.Software Restriction Policies (SRP)SRP는 관리자가 시스템에서 실행할 수 있는 애플리케이션을 제어할 수 있게 해주는 기능입니다. 이는 특정 파일 유형이나 경로에서 실행되는 프.. 2024. 5. 8.
Docker Desktop 불필요한 이미지 삭제하는 배치 스크립트 Windows Docker Desktop에서 이미지 목록을 가져와서 태그 값이 'none'인 이미지를 삭제하는 배치 스크립트를 작성하겠습니다. 이 스크립트는 Docker 명령어를 사용하여 'none' 태그가 있는 이미지를 찾아 삭제합니다. 아래의 스크립트를 참고하세요. @echo off SETLOCAL ENABLEDELAYEDEXPANSION REM 이미지 목록을 가져옵니다. FOR /f "tokens=*" %%i IN ('docker images -f "dangling=true" -q') DO ( SET imageId=%%i REM 태그가 'none'인 이미지를 삭제합니다. docker rmi !imageId! ) echo Done ENDLOCAL 이 스크립트는 다음과 같이 동작합니다. docker i.. 2024. 3. 1.
Bash Script: How read file line by line (best and worst way) Input: $ cat sample.txt This is sample file This is normal text file Source: $ cat readfile.sh #!/bin/bash i=1; FILE=sample.txt # Wrong way to read the file. # This may cause problem, check the value of 'i' at the end of the loopecho "###############################" cat $FILE | while read line; do echo "Line # $i: $line" ((i++)) done echo "Total number of lines in file: $i" # The worst way to r.. 2014. 9. 19.
JJEncode Script Leads to Drive-By The use of JJEncode in a drive-by download has been around for a couple of years but has been popping up a lot recently. A couple of readers have asked how to deobfuscate this so here’s a walkthrough with a live script.Here’s an automobile forum that’s been compromised:Viewing the source code, this link kicks off the infection:Then from alnera.eu, you end up getting this strange looking Javascri.. 2014. 4. 8.
NMAP을 사용한 Conficker 탐지(Scanning) ■ Install 1. 다운/패키지설치(소스설치-비추천 : http://nmap.org/download.html) wget http://nmap.org/dist/nmap-5.00-1.i386.rpm rpm -vhU nmap-5.00-1.i386.rpm 2. nmap 사용 ( 콘피커 관련 설정 ) nmap -PN -T4 -p139,445 -n -v --script smb-check-vulns,smb-os-discovery --script-args safe=1 10.1.1.10 * 맨끝에 10.1.1.10을 타겟이 될 Windows 관련IP로 변경하시면 됩니다. ■ 사용 예제 1-1. 콘피커 비감염시 - 간편모드(grep만 줫을뿐입니다) [root@localhost /]# nmap -PN -T4 -p139,.. 2013. 8. 5.