Image
 
linkedin_logo.png rss_logo.jpg
twitter_logo.png youtube_logo.jpg
Latest Additions
 
EH-Net Login
Welcome Guest.






Lost Password?
No account yet? Register
Who's Online
We have 43 guests online
 
Advertisement

You are here: Home arrow Ethical Hacking Discussions and Related Certificationsarrow Programmingarrow Problem with a shellcode...
EH-Net
May 18, 2013, 05:27:37 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Go back to The Ethical Hacker Network Online Magazine Home Page
 
   Home   Help Calendar Login Register  
Pages: 1 [2] 3   Go Down
  Print  
Author Topic: Problem with a shellcode...  (Read 17394 times)
0 Members and 1 Guest are viewing this topic.
Ketchup
Hero Member
*****
Offline Offline

Posts: 1021



View Profile
« Reply #15 on: May 14, 2010, 11:01:50 AM »

Sil, could it be SEHOP on Windows 7 stopping you?   I believe it is on by default in Windows 7, and needs to be manually enabled in Vista.
Logged

~~~~~~~~~~~~~~
Ketchup
sil
Hero Member
*****
Offline Offline

Posts: 549



View Profile WWW
« Reply #16 on: May 14, 2010, 12:16:26 PM »

Sil, could it be SEHOP on Windows 7 stopping you?   I believe it is on by default in Windows 7, and needs to be manually enabled in Vista.

Nah, Win7 you have to enable it as well AFAIK: "By default, SEHOP is disabled in Windows 7 and in Windows Vista. To enable SEHOP manually, follow these steps: Click Start, click Run ... " (http://support.microsoft.com/kb/956607)

Just so you know though (for those who don't): XOR, POP, POP, RET >= SEHOP (http://www.sysdream.com/articles/sehop_en.pdf) Sotirov and a few others have written about this. My guess on my end... My Win7 Ultimate is just polluted with junk constantly running. E.g., just an hour ago I plopped on Oracle's BPM Studio 10.3 to fiddle with it. So it could just be a combination of bloat. I know funny things started after Cenzic's Hailstorm which tried to fiddle with my .net and ESPECIALLY after I started making Klocwork Architect connections to a server. I think my registry is somehow in a double tee eff state.

I will dig into it a little more some other time (tinkering with Win7) however, this is just for my sanity. I envision in like 4-5 years Win7 becoming to attackers what 2000, 2003, XP now is. So I figured I'd try on my own to learn porting POC's and learning to weaponize them seamless before I submit vulns and stuff. Nothing sucks more than having it work on say 2-3 of your own machines but not being repeatable by a vendor.
Logged

Ketchup
Hero Member
*****
Offline Offline

Posts: 1021



View Profile
« Reply #17 on: May 14, 2010, 12:24:24 PM »

I stand corrected.   I thought Win7 enabled it out of the box.   That's good to know, thanks!
Logged

~~~~~~~~~~~~~~
Ketchup
sil
Hero Member
*****
Offline Offline

Posts: 549



View Profile WWW
« Reply #18 on: May 14, 2010, 12:44:33 PM »

I stand corrected.   I thought Win7 enabled it out of the box.   That's good to know, thanks!


Couldn't find documentation on win2008. I have it installed on a VMWare machine that I barely use Sad My theory/thought is, if it works on win7 it should work on W2k8. What I have noticed intermingling is that for the most part, if I start say fuzzying something on XP and get a working control of registers, I can usually mimic it down (2003) and up (Vista) *most* of the times with little work. When I do the same on Vista *sometimes* I can mimic it on XP. When I do *anything* on the 7 side, almost always get kernelbase errors with no way to find out where (address) this occurs. No matter what debugger I use, no matter how many breakpoints I set... fail Sad should post screenshots... coding failblog or something... "exploit fail" where instead of calcor notepad you get ... nothing Grin
Logged

H1t M0nk3y
Hero Member
*****
Offline Offline

Posts: 864



View Profile
« Reply #19 on: May 14, 2010, 01:52:22 PM »

I am still learning and I can't obviously help you. However, once I am done with the PWB course, I will definitively spend more time playing with these tools. To me, this is the real deal!

Logged

OSCP, GPEN, GWAPT, GSEC, CEH, CISSP
sil
Hero Member
*****
Offline Offline

Posts: 549



View Profile WWW
« Reply #20 on: May 14, 2010, 03:36:15 PM »

I am still learning and I can't obviously help you. However, once I am done with the PWB course, I will definitively spend more time playing with these tools. To me, this is the real deal!

As of late/mid last year, I began having more fun learning programming, reverse engineering in regards to security. Personally, I find it more challenging than the typical "pentesting" involving scanning, enumerating, social engineering, etc. I can say from experience it (programming/exploitation) is definitely more nerve wrecking and "intimate" (for lack of better words right now).

When it comes to vanilla (above mentioned tests) pentesting, I've always found that (in my count) about 60+% is horrible configurations and overlooked items. 30+% social engineering 10% "extreme exploiting". There have been ONLY two instances this year where I had to escalate privileges on a pentest from a fluff user to root. These occurred on *nix machines. The rest, tended to be bad configurations and lack of security awareness. I've performed 3 solid pentests consisting of about 100-125 servers/routers/switches/PBX's.

One client (99.99999% Linux) had ONE Windows machine which sadly was configured safer than their entire Linux infrastructure. They have 1 full /21 and about 3 separate /24's. Their engineers decided to use sshkeys and some genius thought he would save all his engineers time by changing all their UID's to 0. Fun Wink ... They had an old version of Cacti running on ONE server that got them owned.

Anyway... I like reversing/coding. A lot more thought to me is involved. I'm personally at an impasse where security is too repetitive for me. Reversing is like ... "huh!?@!" So don't feel like you can't respond to anyone ever Wink we're all going through learning phases. Heck I learn from everyone so I've always been humbled to learn and eager to share... Sometimes though, my wording (perhaps poor choices of phrases) lead people to misconstrue a response as elitist or arrogant. I'm no smarter/leeter than anyone. Security remains a learning game. Don't let anyone tell you different Wink Sure there are plenty who can mop the floor with my coding talent... I could do it with packet-fu (been doing so since circa 97)... Does it make me better? Nah, I likely know something they don't care for and vice versa. We're all learning here no?
Logged

n1p
Jr. Member
**
Offline Offline

Posts: 89


View Profile WWW
« Reply #21 on: May 15, 2010, 03:32:27 AM »

What's your fuzzer of choice?
Logged
Equix3n-
Sr. Member
****
Offline Offline

Posts: 386



View Profile
« Reply #22 on: May 15, 2010, 04:20:43 AM »

This thread has been bugging me continuosuly. The thing is, I've no experience in exploit development whatsoever and can't participate in the discussion. Although I've started learning a bit about buffer overflow exploit development (n1p's article was a great inspiration), I still have a lot to learn. Would someone link me to some good online resources to learn from? Furthermore, from where do I start? Links to books will be helpful too.
I'm thinking about buying 'The Shellcoder's Handbook: Discovering and Exploiting Security Holes'. The table of contents looks impressive and frankly doesn't look too difficult as I have some programming experience.
« Last Edit: May 15, 2010, 08:43:03 AM by Equix3n- » Logged
n1p
Jr. Member
**
Offline Offline

Posts: 89


View Profile WWW
« Reply #23 on: May 15, 2010, 08:36:07 AM »

I would certainly echo sils comments about windbg. It is extremely powerful and I would recommend developing the exploit using it to get some experience with it.

Congrats by the way Smiley

Equix3n, take a look at hacking: art of exploitation and dino zovi videos on vimeo, corelan.be,uninformed.org,grey-corner blog. They will provide further valuable links
Logged
Equix3n-
Sr. Member
****
Offline Offline

Posts: 386



View Profile
« Reply #24 on: May 15, 2010, 08:41:59 AM »

Thanks n1p! I'll certainly check them Smiley

Edit: I checked the links and found out that I already had two of them bookmarked. Looks like I was on the right path. What about 'The Shellcoder's Handbook'? Should I buy it or not?
« Last Edit: May 15, 2010, 10:39:52 AM by Equix3n- » Logged
sil
Hero Member
*****
Offline Offline

Posts: 549



View Profile WWW
« Reply #25 on: May 15, 2010, 10:27:51 AM »

What's your fuzzer of choice?

Depends on what I'm fuzzing Wink Peach is an all around awesome tool and straightforward. You can't beat Commraider for ActiveX. Protos is a good framework to edit on your own. Commercially... Klocwork rocks. I've heard the world about Codenomicon but I've yet to purchase a copy or see it demo'd although I spoke with them about 2 weeks ago.

Logged

sil
Hero Member
*****
Offline Offline

Posts: 549



View Profile WWW
« Reply #26 on: May 15, 2010, 10:51:45 AM »

I'm thinking about buying 'The Shellcoder's Handbook: Discovering and Exploiting Security Holes'. The table of contents looks impressive and frankly doesn't look too difficult as I have some programming experience.

Shellcoders Handbook is great and so is Jack Koziol. I had the opportunity to correspond with Jack a few times here and there and he is a kick ass cool person. As are Dino whom I also bug from time to time.

Equix3n: Before you fork out money for the book though, although it looks easy, once involved more heavily, there is really no *one* book that will give you that "aha! NOW I GET IT" Here is a list Dino Dai Zovi sent me when I had a question pertaining to some Quicktime stuff I was lost on: http://TinyURL.com/bughunters
Just to let you understand how difficult/weird/frustrating it is for most security researchers... (apologies if you stumble on this Dino): I was fuzzing Quicktime for one of my classes and trying to get a workable (weaponized) exploit for Quicktime: (http://www.infiltrated.net/OWNING-QUICKTIME) I was frozen here. All was working as planned with complete control of my registers (EIP, EAX, etc., all were 'ownable') yet I couldn't pop my calc. Frustrated I sent a quick email to Dino asking what am I doing wrong:

I'd again insist that you should double-check that the surface that you are fuzzing is available via a web page, try and at least trigger a crash from a web page to make sure.  You don't want to take an early victory lap only to discover that it's not an actual security vulnerability (trust me, this happens to me at least a few times a year and it *sucks*).

At the end of it (my fuzzing) I had to completely drop and revamp a working exploit even though I had control in the first place... By the way n1p, ketchup if you guys follow the horrendous output, you'd notice the use of byakugan in there... Mushishi rocks!

Code:
0:004> g
(1518.1918): Unknown exception - code c0000096 (first chance)
CAUGHT A BP
CAUGHT A BP
CAUGHT A BP
eax=7efde000 ebx=0378f604 ecx=0378f654 edx=030fd7e8 esi=00000000 edi=00370000
eip=773744ec esp=0378f5f0 ebp=0378f984 iopl=0         nv up ei pl zr na pe nc
cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00000246
ntdll!RtlDispatchException:
773744ec 8bff            mov     edi,edi
0:005> g
CAUGHT A BP
CAUGHT A BP
CAUGHT A BP
eax=7efde000 ebx=032bf7a4 ecx=032bf7f4 edx=02a0db38 esi=00000000 edi=00370000
eip=773744ec esp=032bf790 ebp=032bfb24 iopl=0         nv up ei pl zr na pe nc
cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00000246
ntdll!RtlDispatchException:
773744ec 8bff            mov     edi,edi
0:004> g
(1518.10c0): Access violation - code c0000005 (!!! second chance !!!)
eax=7efde000 ebx=00000000 ecx=00000001 edx=7741a1b8 esi=00000000 edi=00370000
eip=deadc0de esp=0378f920 ebp=0378f984 iopl=0         nv up ei ng nz ac po cy
cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00010293
deadc0de ??              ???

Equix3n is not always easy in fact some of your most frustrating days will be getting an exploit working correctly however... (and this is a big however....) Simply demonstrating enough control over registers (EIP, etc.) is enough to report. If you follow the "no more free bugs" them, you aren't doing companies any favors by providing free security research and fixes to them. Sure there is the potential glory of saying "Found vulnerabilities in X, Y, Z" The truth at the heart of the matter is, time is money. After some time you won't even care about any so called glory. Ready? Apple, SAP, IBM, VMWare, Microsoft, F5, Oracle... Within the past 8 months I have cases opened with various vendors on bugs I've found. Some with CERT, some with IDefense some with ZDI... Means nothing at the end of the day seriously... I've spent countless hours on my own time when I could have been spending it with family or enjoying life. My attitude shifted into the "no more free bugs" mode where I'm learning for dual reasons now... 1) To understand/learn/enjoy security more 2) make money. We all have bills to pay.

So here is my link contribution for you:

http://pentest.cryptocity.net/

I'd start with Reverse Engineering, Fuzzing, Exploitation then client side exploitation in that order. I'd go over all the videos and walk throughs over and over until you don't have any questions you would ask if you were in the class.
Logged

Equix3n-
Sr. Member
****
Offline Offline

Posts: 386



View Profile
« Reply #27 on: May 15, 2010, 11:13:42 AM »

That's some list sil! Thanks for the response. I haven't thought about "free bugs" or "money for bugs" approach, neither I want to do it for glory. I just have a desire to learn it. I think it'll make me a better security professional. Furthermore, as I already stated in a previous post, I was very much inspired by n1p's exploitation article. One other article I would like to mention is Past, Present, Future of Windows Exploitation.. It's an excellent read and will help to understand how exploits have evolved over time. Also, exploit development is one area of security I haven't really touched, so learning anything about it, even if not up to an expert level, will satiate my desire.
« Last Edit: May 15, 2010, 11:19:03 AM by Equix3n- » Logged
zeroflaw
Full Member
***
Offline Offline

Posts: 208



View Profile
« Reply #28 on: May 15, 2010, 11:15:05 AM »

This topic is becoming really really interesting. Now I have tons of additional resources..where am I going to find the time lol?
Logged

ZF
Equix3n-
Sr. Member
****
Offline Offline

Posts: 386



View Profile
« Reply #29 on: May 15, 2010, 11:24:40 AM »

This topic is becoming really really interesting.
All credit goes to sil. I wonder why didn't I meet him before Grin
Logged
Pages: 1 [2] 3   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines
Joomla Bridge by JoomlaHacks.com
Valid XHTML 1.0! Valid CSS!
Page created in 0.075 seconds with 22 queries.
 
Exclusive Deal

sansfire13_245x90_cw90.jpg
SANSFIRE 2013
June 15 - 22

5% Off w/ Code: EHN_5

SANS Deals 4 EH-Netters
5% OFF Any SANS Course in Any Format!
Coupon Code: EHN_5 Including SANS Rocky Mountain 2013 & SANS Boston 2013
Polls
Compared to this year, 2013 will be:
 
Recent Forum Topics
EH-Net News Feeds
Latest Additions
 
         
Advertisement

© 2013 The Ethical Hacker Network
Joomla! is Free Software released under the GNU/GPL License.