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 58 guests online
EH-Net News Feeds
Latest Additions
 
Advertisement

You are here: Home arrow Forum arrow Ethical Hacking Discussions and Related Certificationsarrow Malwarearrow Wannabe "Ethical Hacker" - Trying to learn privilege escalations
EH-Net
May 25, 2012, 03:06:44 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Advertise on EH-Net!! - Reasonable Rates, Highly Targeted Audience.
 
   Home   Help Calendar Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: Wannabe "Ethical Hacker" - Trying to learn privilege escalations  (Read 7741 times)
0 Members and 1 Guest are viewing this topic.
nokaoi77
Newbie
*
Offline Offline

Posts: 5


View Profile
« on: February 20, 2010, 10:54:20 AM »

good morning all,

total newbie here...

unfortunately for me...i am both, new to linux (my apologies, 20/yrs windows, 0 linux) LOL and, new to exploiting systems. and on top of these obstacles, i am doubling my frustration by pursuing related credentials of CEH (Certified Ethical Hacker) and CPT (Certified Penetration Tester), so as i am sure you can guess, i am feeling insane and well out of my comfort zone/league.

down to it!

i am searching for help - forums where i can communicate my needs and receive help/guidance.
heck, i would love to pay for a couple hours worth of PROFESSIONAL (well, better than me anyhow) training...
i just cant seem to find such resources.

anyhow, so, my situation...

i have a VM for my lab testing,
friends chose RedHat7
it using Kernel 2.4.20

goal is to acquire the SHADOW/PASSWD files and crack them, specifically user of root

i am as far as 1 user account in, i can log into the gui of RedHat, see directories (cept those without permissions)

need help with the following;

1. IMMEDIATE HELP/OBJECTIVE
- finding a local privilege escalation to root exploit (i.e. do_brk, crash, krnl, ptrace, etc.)
- compiling, installing, running the code
- gaining root access and i can take it from there (i hope)

2. NEXT GOAL
something else i want to learn, is SSH Brute Force (hydra, brutessh, etc.)
i use them, but they are NOT working....i think because the initial attempt is prompting for accepting the SSH key, but the Brute apps are not accepting it - i think!

LAST OBJECTIVE
finally, using metasploit to remotely compromise the system (what exploit and how to use it properly (payloads, configs, etc.


well, these are ALL goals of the training i want to pursue over this weekend and next....

can someone, anyone point me in the right direction!

provide assistance, recommendations/suggestions/lists of some resources that can help, propose where i can find the help to achieve those objectives above?

thanks for your time and efforts - WELL IN ADVANCE!!!

kindest regards,
nokaoi77
Logged
zeroflaw
Full Member
***
Offline Offline

Posts: 184



View Profile
« Reply #1 on: February 20, 2010, 11:22:50 AM »

Welcome. Well I think your goals are quite unrealistic, especially when you're trying to accomplish them over the weekend. You say you have no experience with Linux, so how can you expect to find exploits so fast unless you know what you're doing. I would suggest you read some books about Linux, learn to work with the Linux terminal and experiment with the commands. Also try to pick up information about bash scripting and Perl.

ZF
Logged

ZF
chrisj
Hero Member
*****
Offline Offline

Posts: 997


View Profile
« Reply #2 on: February 20, 2010, 11:45:31 AM »

To follow up on what ZeroFlaw has said, you'll need the CLI for the majority of what you want to try and do.

Take a look at chapter 11 of Hacking for Dummies 3rd edition (don't let the name fool you), and skim the Table of Contents and index of Hacking the Next Generation.

If you don't already have one, get an O'Reilly Safari account. You're going to be reading a lot. I know my account has been getting a work out lately.

Since you are using an older version of Redhat, you might be able to do some hunting on Google and other search engines for exploits against it.

Lastly Brute forcing takes time. Lots and lots of time.
Logged

OSWP, Sec+
nokaoi77
Newbie
*
Offline Offline

Posts: 5


View Profile
« Reply #3 on: February 20, 2010, 01:46:59 PM »

ZeroFlaw and chrisj,

appreciate the replies...thanks for the postings!

i will look into the Hacking for Dummies material, didnt realize it was available.
so you know, i did buy the nmap and snort books already.
but there not geared towards local exploits, or root priv escalation which is my current objective.

but also, would you know where i can get assistance for those i have listed?
something more proactive, where communication (or perhaps hand holding) is available?
some place where i can obtain interactive, tell me what the heck to do assistance?

i am not oppose to paying for help, its just learning and not harmful or illegal actions i am pursuing, as i presume most intentions are on this site.

books are limited, they say what SHOULD happen, but when that doesnt, its those periods i need the extra push (and not off a cliff either) LOL

well, to elaborate;

as mentioned, while certainly not new to computers/windows, linux is indeed new.
i've worked with /etc/shadow and /etc/passwd files already in earlier labs.
i am familiar with jtr, cain n abel, etc.
taking hashes and running them to jtr, i have 3-4 passwords already.

i have already, successfully completed other parts of my labs, using Priviledge Exploits (but they worked and were without incident-on CentOS, different kernel - worked like a charm).

however, i can also correlate parts of windows to linux, in that CLI/Terminal similarities exist.

on my lab, i DO HAVE TERMINAL access, except to those important directories/files limited by permissions, hence the Privilege Escalation help i need.

yes, i know brutessh "can" take a long time;
 however, when you know users/passwords on a system (i know 2-3 accounts and their passwords, as i can login via the OS Gui just fine), when i manually enter the passwords into password dictionary text files, use the app, point to that dictionary and things just dont work as expected, thats what i am trying to overcome.

why when i issue ./brutessh.py does it begin properly, go thru the list and literally just PASS UP the actual password i know it really is - why doesnt it stop and tell me, hey, heres the password like i believe/understand it suppose to.

in this example, when i manually SSH to the box, it immediately prompts for accepting the encryption key for the SSH session.

i dont think these BF SSH apps are seeing that, nor accepting it, either etc.

on the code issues...
i have what i feel is the code mentioned earlier...like an do_brk.c, ptrace_attach.c files and others.

but, when attempting compilations, i get numerous problems/errors.
0 memory not available
include missing
etc.

its these types of obstacles i need further direction on.

determining why exactly the SSH is failing and how to overcome it
i.e. is there somwhere in the app that i should be telling it
if prompted for a key, say yes!

determining why the 0 memory msg/etc. shows, how to overcome/resolve
is my compling method wrong, is something missing, is the code not working, is the OS patched against it, etc, etc, etc.


this is where i am heading....seeking more direct, hand holding input/guidance.

well...guess i better start my day finally....

thanks again and good luck to you both!
Logged
zeroflaw
Full Member
***
Offline Offline

Posts: 184



View Profile
« Reply #4 on: February 20, 2010, 02:40:55 PM »

Well I'm no Linux hero or anything so I'm not sure if I can really help you. As for privilege escalation, I would probably start looking for programs or services that run under root privileges, and see if you can find exploits on the internet.

I recommend buying the book "Hacking The Art of Explotation", to get a deeper understanding of how exploitation works and how to develop exploits. It explains everything from programming to writing your own exploits and shellcode.

About the compiling part, well do you have any C programming experience? C source files are mostly compiled using the GCC compiler. It's usually as simple as;

gcc -o outputfile sourcefile

So in your case that would be;

gcc -o ptrace_attach ptrace_attach.c

Then run it with;

./ptrace_attach

My SHH knowledge is rusty and limited, so I'm probably not the right person to help you with that.

ZF
Logged

ZF
chrisj
Hero Member
*****
Offline Offline

Posts: 997


View Profile
« Reply #5 on: February 20, 2010, 03:21:06 PM »

Since we're playing under the idea that this is all ethical training (group of friends playing capture the box or something on a private lab)

if you want to pay for a class, while not exactly hand holding, the first one that comes to mind is PWB / OSCP.

It'll be a lot thrown at you and take longer than the time you have.

if you have other user accounts already... Look into sudo.

Last week I was working with JTR and kept getting failures. I spent a couple of hours looking into why.  It didn't work the way the book said, but I learned a lot out side of the book trying to figure out why it wasn't working.
Logged

OSWP, Sec+
nokaoi77
Newbie
*
Offline Offline

Posts: 5


View Profile
« Reply #6 on: February 20, 2010, 04:13:56 PM »

okay, thanks will run with those for now...

i believe i was already doing some of that, but will retry when i return home tonight, then post the results to get your interpretations.

yes, i am using the gcc commands, also tried g++, results are same/similar when i run against code i have.

thanks again, appreciate the input!
Logged
nokaoi77
Newbie
*
Offline Offline

Posts: 5


View Profile
« Reply #7 on: February 20, 2010, 06:13:25 PM »

ok, havent left yet =)

doing so now, but i was able to run it and copy/paste my results for evaluation. below are summary samples of problems, but i will attach full .TXT file for review.

can you tell what, if anything, i am doing wrong???
or, can you point me to where i might get the help to get these up/working?

i sure as heck cannot figure it out =(

well, thanks though!

================

root@bt:/usr/include# ls | grep crash
crash.c

root@bt:/usr/include# ls | grep do_
do_brk.c

root@bt:/usr/include# ls | grep krn
krnl.l.c

root@bt:/usr/include# ls | grep ptra
ptrace_attach.c


*************************************************************************
PROBLEM 1
root@bt:/usr/include# gcc -o crash crash.c
crash.c: In function 'Handler':
crash.c:8: error: memory input 0 is not directly addressable
crash.c:10: error: memory input 0 is not directly addressable
*************************************************************************

*************************************************************************
PROBLEM 2
root@bt:/usr/include# gcc -o do_brk do_brk.c
do_brk.c:1: error: expected identifier or '(' before '/' token
In file included from /usr/include/stdio.h:75,
                 from do_brk.c:3:
/usr/include/libio.h:332: error: expected specifier-qualifier-list before 'size_t'
/usr/include/libio.h:364: error: expected declaration specifiers or '...' before 'size_t'
/usr/include/libio.h:373: error: expected declaration specifiers or '...' before 'size_t'
*************************************************************************

*************************************************************************
PROBLEM 3
root@bt:/usr/include# gcc -o krnl krnl.l.c
krnl.l.c: In function 'TakeDown':
krnl.l.c:54: error: memory input 0 is not directly addressable
*************************************************************************

*************************************************************************
PROBLEM 4
root@bt:/usr/include# gcc -o ptrace ptrace_attach.c
ptrace_attach.c:2: error: expected identifier or '(' before '--' token
ptrace_attach.c:8:24: error: linux/user.h: No such file or directory
ptrace_attach.c: In function 'main':
ptrace_attach.c:25: error: storage size of 'regs' isn't known
*************************************************************************

root@bt:/usr/include#
Logged
nokaoi77
Newbie
*
Offline Offline

Posts: 5


View Profile
« Reply #8 on: February 20, 2010, 06:18:51 PM »

oh, also...this stuff below...
it worked perfectly, just like the video and code downloaded!

hence my comparison, why i cannot get this stuff to work, yet this first attempt onto another VM with CentOS, it worked like a charm

How to LOCAL ROOT EXPLOIT video
http://www.youtube.com/watch?v=ShoAOdx0K7I

and, i found the code/tar via Google in about 5min, placed onto system, ran it and just like the video - it worked =)

guess all things in life cannot be that easy
LOL

take care!
Logged
chrisj
Hero Member
*****
Offline Offline

Posts: 997


View Profile
« Reply #9 on: February 20, 2010, 08:56:00 PM »

Quote
crash.c: In function 'Handler':
crash.c:8: error: memory input 0 is not directly addressable
crash.c:10: error: memory input 0 is not directly addressable

Those are error messages. the In Function tells you what part of the code, the ones with numbers are the line numbers to look at.

As to why it works on CentOS but not the older Redhat, may have to deal with what libraries and other packages are installed on each box.
Logged

OSWP, Sec+
tjbigshot9919
Newbie
*
Offline Offline

Posts: 2


View Profile
« Reply #10 on: March 09, 2010, 02:54:52 PM »

yeah, same here im new at hacking but a friend of mine suggested the book series "hacking exposed". its VERY good. tons of info on pretty much anything.
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines
Joomla Bridge by JoomlaHacks.com
Valid XHTML 1.0! Valid CSS!
Page created in 0.375 seconds with 23 queries.
 

gk_static-ad_feb2012.jpg
Global Knowledge: Build Security Skills to Protect & Defend

els_130x200fixed2.gif
eLearnSecurity Student Course Now Live!
5% Off with Code
ELS-EH-5

SANS Deals 4 EH-Netters
$150 OFF Any SANS Course in Any Format!
Coupon Code: EHN_Connect Including SANS Security West 2012 & SANSFIRE 2012
Recent Forum Topics

cbtnuggets_logo_125.jpg
Try CBT Nuggets Free!

Vote For EH-Net

Add to Technorati Favorites
technorati fave

 
         
Advertisement

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