Tutorial IDA PRO Debugging Via WMware Linux / OS X

Storm Shadow

Administrator
Staff member
Developer
Ida Pro Expert
Elite Cracker
When trying to remote gdb to an wmvare linux shell, you soon find out that its almost impossiple.
You get message in ida pro

Code:
Can not set debug privilege
 
or Target denide connection

Even hex-rays own Toturial i shitty and dosent offer direct debugging.
http://lmgtfy.com/?q=ida+pro+vmware

Well after some research i can show howto do this correctly
It was an long road o_O


account debug privilege
1)
1. Run the "Local security setting" administrator by typing "secpol.msc" in the Run... option of yout start menu.
2. Expand the tree by clicking the "Local policies" item.
3. Select the "User Rights Assignment" item.
4. Double-click the "Debug programs" option in the right panel.
5. Click "Add user or group..." button.
6. Insert the user name and click "Check names" button.
7. Click the OK button and close all opened windows.
8. You have to restart your session.

Setting up Wmware workstation

onfiguration Parameters
  • VMware Workstation 10 running on Windows 8 PRO
  • The Virtual Machine is an Fedora / PSLGHT4ALL
  • The virtual NIC is configured with DHCP
2)
1. Open Virtual Machine Settings (Rightclick -> Settings…) and set your virtual machines network connection to “NAT

0vuW7mA.jpg


2. Power on the Virtual Machine and write down the IP address (You could also use a static IP address)


JBnQOnm.jpg


3. Open Virtual Network Editor (Edit -> Virtual Network Editor…)
4. Select VMnet8 / NAT and press NAT Settings…

UPl0cdH.jpg


5. Click Add6. Configure Port and IP address
ida pro uses port 23946 remember to do both TCP and UDP

igDkwyC.png


7.Press OK twice to close NAT Settings and Virtual Network Editor



Making Firewall Rule

3)


1. Open Windows Firewal with Advanced Security (Run > WF.msc)
pQzcF8h.png


2. Rightclick Inbound Rules and press New Rule…


yZPZLD3.png


3. Select the rule type Port

9UQepwD.png


4. Select TCP and specify Port 23946
Do the same again just with UCP!!

u54xCPN.png


click next then allow all >>> save
Do the same for OUTBOUND RULE !!



Make the image listen fo ida pro
5)

Locate your *.vmx file
mine is psl1ght-dev.vmx
open and insert these lines.


Code:
debugStub.listen.guest32 = "TRUE"
debugStub.listen.guest64 = "TRUE"
debugStub.hideBreakpoints = "TRUE"
debugStub.listen.guest32.remote = "TRUE"
debugStub.listen.guest64.remote = "TRUE"


TESTING
6)
open virtual machine.
Copy linux_server and linux_serverx64 på virtual machine

Run command in shell

Code:
[user@psl1ght-dev server]$ sudo ./linux_server64 -Ppass
 
IDA Linux 64-bit remote debug server(ST) v1.14. Hex-Rays (c) 2004-2011
Listening on port #23946...

open ida With ADMIN Rights
i use ida 64

Press Debugger >> attatch remote debugger >>> Remote Linux Debugger

6zBtdTu.png


And Success

wGwDCoH.png



TEST 2
close ./linux_serverx64
Remote GDB

grapp the elf from here
http://techbliss.org/threads/linux-executable-walkthrough-binary-source.472/#post-1128

copy to VM machine

run in shell

Code:
[user@psl1ght-dev server]$ gdbserver localhost:23946 simple.elf
Process simple.elf created; pid = 1831
Listening on port 23946

open ida pro with admin rights
then debuggers >> attatch >> Remote GDB

You can change debugger settings to stop on debugging start, but this is only a test.

see what happends

6S9MWIn.png


yep finds it all right.normally it refuses to connect after this step

RyjgQnC.png


GezOFUJ.png


SUCCESS.
 

Storm Shadow

Administrator
Staff member
Developer
Ida Pro Expert
Elite Cracker
where I can download "linux_server64 -Ppass"?.

the linux server is shipped with ida pro
linux_server = 32 bit
linux_serverx64 = 64 bit
the -Ppass is part off the command

-p = port
-P = Password
remember no space like so.
linux_server -p23946 -Pmypass
 
2

203030

Guest
my vmware os is kali
i dont know what should i do ?
it doesnt permit
 

Attachments

  • gdb.JPG
    gdb.JPG
    50.8 KB · Views: 9

Storm Shadow

Administrator
Staff member
Developer
Ida Pro Expert
Elite Cracker
i have to disable antivirus in windows , and its important that i run ida with admin privl.Also did you open your ports in Wmware ?
 

mehdi

New member
i have to disable antivirus in windows , and its important that i run ida with admin privl.Also did you open your ports in Wmware ?

i did it now ! all of it
except the first part of tuturial my windows doesnt have Local security setting" but i entered as admin !
 

Storm Shadow

Administrator
Staff member
Developer
Ida Pro Expert
Elite Cracker
ohh youre using windows 8 ?
they actuelly disapled you options to fiddle with the account debug privilege.
You need windows 8 pro to enable this "hurray Microsoft":depressed.png:
 

Storm Shadow

Administrator
Staff member
Developer
Ida Pro Expert
Elite Cracker
C:\Windows\System32\secpol.msc
there poberly have been some screwup to your PATH in invirament settings you should add C:\Windows\System32 to your path
 

hachzz

New member
sir,
when i click on "Attach -> Remote Linux debugger", i have error message:
upload_2014-8-23_15-0-17.png

and "Ouput windows":

upload_2014-8-23_15-3-38.png

i did as your instructed, but i dont know why it happens (im new in ida).
pls help me... ty.
 

Storm Shadow

Administrator
Staff member
Developer
Ida Pro Expert
Elite Cracker
ahh you are using wrong version. it loads the pc(pc.32) insteed off linux so error.
Do you do

Code:
sudo ./linux_server64
on the linux image ?
What image are you running in virtual box ?
 

hachzz

New member
im using vmware player with vmnetcfg (from vm workstation 10):
upload_2014-8-23_16-31-41.png
linux: backtrack 5r3 x86 (base-on ubuntu 12 LTS) (default-root user).

pls help... :D

bonus: my NAT config:
upload_2014-8-23_16-37-15.png
 

Attachments

  • upload_2014-8-23_16-37-16.png
    upload_2014-8-23_16-37-16.png
    72.8 KB · Views: 1
Top