2016년 Splunk Boss of the SOC 1회차 문제를 풀어볼 수 있다.
홈페이지 변조 사건과 랜섬웨어 감염에 대한 Splunk 분석이 주제다.
특징
•
검색 범위가 그리 넓지 않고, 서버가 생각보다 넉넉해 소스 타입을 지정하지 않고도 전체 시간 범위 일반 문자열 검색이 꽤 빠르다. (ex. “Splunk”)
•
stats나 eval과 같이 추가적인 쿼리문을 요구하는 문제는 극히 적고 문제에서 요구하는 답을 빨리 찾기 위한 센스가 중심이다.
•
2016년 대회 당시 기준 문제로 Splunk 내부 로그가 아닌 외부에서 찾아야하는 정보의 경우 현재는 구할 수 없거나 유료인 경우가 간혹 있다.
•
문제는 빨리 풀수록 가산점이 붙고 한 번 틀릴 때마다 10점 감점이 있다. 감점을 당하더라도 빠르게 시도해보고 다른 시도로 넘어가는 것이 고득점에 유리하다.
•
1번이 점수가 더 높았음에도 2번에서 시간 소모가 훨씬 오래걸렸다. 웹과 시스템 분야에 대한 이해도가 풀이 속도에 차이를 만든다.
RULES
WriteUp (30/30)
Scenario 1 - Web Site Defacement
Today is Alice's first day at the Wayne Enterprise Security Operations Center. Lucius sits Alice down and gives her first assignment: A memo from Gotham City Police Department (GCPD). Apparently GCPD has found evidence online (http://pastebin.com/Gw6dWjS9) that the website www.imreallynotbatman.com hosted on Wayne Enterprise's IP address space has been compromised. The group has multiple objectives... but a key aspect of their modus operandi is to deface websites in order to embarrass their victim. Lucius has asked Alice to determine if www.imreallynotbatman.com. (the personal blog of Wayne Corporations CEO) was really compromised.
Scenario 2 - Ransomeware
After the excitement of yesterday, Alice has started to settle into her new job. Sadly, she realizes her new colleagues may not be the crack cybersecurity team that she was led to believe before she joined. Looking through her incident ticketing queue she notices a “critical” ticket that was never addressed. Shaking her head, she begins to investigate. Apparently on August 24th Bob Smith (using a Windows 10 workstation named we8105desk) came back to his desk after working-out and found his speakers blaring (click below to listen), his desktop image changed (see below) and his files inaccessible.
Alice has seen this before... ransomware. After a quick conversation with Bob, Alice determines that Bob found a USB drive in the parking lot earlier in the day, plugged it into his desktop, and opened up a word document on the USB drive called "Miranda_Tate_unveiled.dotm". With a resigned sigh she begins to dig into the problem...
후기 및 정리
•
번역은 오역이 많다. 문제가 애매모호한 경우가 많으니 영문을 꼭 제대로 읽어야 한다.
•
Check Sourcetypes . 어떤 소스타입이 있는지 알고 시작하자
| metadata type=sourcetypes index=botsv1
| table sourcetype totalCount
SQL
복사
•
아무리 찾아도 나오지 않는다면 검색 시작에 제한한 범위(ip, 소스타입, 시간)이 잘못된 경우다.
다른 방향의 IP, HOST,Soucetype로 접근하는 습관을 들이자. (S2 #207)
가능하면 (src_ip=”1.1.1.1” OR host=”1111") 과 같이 묶어 검색하는 것도 좋다.
•
Suricata, Windows로그와 같이 자주 쓰이는 소스타입 데이터를 많이 접할수록 유리하다.
•
문제에 Common이 들어가면 Splunk가 아닌 외부 사이트에서 찾아야되는 경우가 대다수다.
•
•
"imreallynotbatman.com" "passwd=batman"
| rex field=form_data "passwd=(?<pass>\w+)"
| transaction pass
| eval duration = round(duration,2)
| table duration
SQL
복사
•
다음은 exe 문자가 들어가는 필드들만 남기고 나머지는 필드 값을 null로 만드는 쿼리다.
src_ip와 %exe% 부분만 수정하면 된다.
sourcetype= * src_ip="192.168.0.0" "exe"
| foreach * [| eval <<FIELD>>=if(like(<<FIELD>>,"%exe%"),<<FIELD>>,null())]
SQL
복사
•
Sysmon 로그를 볼 때 CommandLine 필드가 처음에 보이질 않아서 미추출된 줄 알았는데 다음과 같이 설정하면 볼 수 있었다. 필드값을 찾을 때는 꼭 설정을 ‘모든 필드’로 맞추고 찾자. (S2 #204)
•
•
•