[APP] Shark for Root + SharkReader

Search This thread

snark_be

Senior Member
Sep 17, 2008
677
75
Nexus 7 (2013)
It works fine for me on my rooted HTC Desire. Thanks a lot. I'm looking forward to new features.

Why does it say "killall: not found" when I stop the capture? Is it bad?
 

jcase

Retired Forum Mod / Senior Recognized Developer
Feb 20, 2010
6,308
15,761
Raleigh NC
I suggest if your using kill all to try this from androshark

{"su", "-c", "kill $(ps | grep tcpdump | tr -s ' ' | cut -d ' ' -f2)"});
 

remy2501

Senior Member
Jul 27, 2010
92
2
whats the chances of this thing growing into a full tool to access secured networks? would be really nice to have the freedom of jumping wifi signals after a little sniffing and cracking..

keep up the good work guys.. can't wait to try out whats got started so far..
 

ex87

Retired Recognized Developer
Sep 9, 2008
89
49
36
Ventspils
It is not tool for cracking secured networks and I think it will never be. It's more like debugging (somtimes reverse engineering) tool.
For "cracking" you will need drivers that support monitor mode, tool that can place wifi to that mode (airmom-ng) and then you possibly could use shark for dumping packets, but there is better tools for that purpose..

Sent from my Nexus One using XDA App
 

o4kareg

Senior Member
Mar 31, 2010
154
10
42
Krasnodar
4pda.ru
version 0.9.9 from Market causes such a bug.
When logging launched, and "Open file" button is pressed, an UNDELETABLE error message appears, it remains on the screen even after exiting Shark. Screenshot attached.
 

Attachments

  • post-239768-1282814134.png
    post-239768-1282814134.png
    76.7 KB · Views: 597

mrmrmrmr

Senior Member
Jan 14, 2007
2,552
257
I just tried the0.9.9 version on my Dell Streak. It gives a link error and no packets are captured.
However, if I run tcpdump from a terminal app, I can successfully sniff traffic.
Probably use of tcpdump commandis not suitable for Dell Streak.
How can we solve this ?
 

mrmrmrmr

Senior Member
Jan 14, 2007
2,552
257
I just tried the0.9.9 version on my Dell Streak. It gives a link error and no packets are captured.
However, if I run tcpdump from a terminal app, I can successfully sniff traffic.
Probably use of tcpdump commandis not suitable for Dell Streak.
How can we solve this ?

any idea ?
 

bjg222

Senior Member
Nov 9, 2009
183
29
Atlanta, GA
This app is great and really useful for debugging my app, however, I have a problem when trying to stop the capture. When I hit the stop button, the phone freezes, then my ROM restarts! The pcap file is perfectly normal and usable, and nothing seems to be wrong upon restart, but it's a bit of a nuisance.

I'm using an HTC Hero (GSM, N American version), running Android 2.1 (VillainROM 12.0, rooted), and version 0.9.9 of Shark for Root from the Market
 

mrmrmrmr

Senior Member
Jan 14, 2007
2,552
257
I am still waiting for the author to reply about my problem...
Should I have a little hope ?
 

d3sm0nd

Senior Member
Dec 28, 2007
583
16
Sofia
Just wanted to say thanks... keep adding more functions! :)

I just tested it with combination of WirelessTether... I was able to sniff all the traffic of the clients connected. :D

BTW, any useful parameters that we could add to tcpdump?
 

mrmrmrmr

Senior Member
Jan 14, 2007
2,552
257
I getthis error:

reloc_ library cannot locate '__aeabi_fdiv'
"CANNOT LINK EXECUTABLE"
 

mrmrmrmr

Senior Member
Jan 14, 2007
2,552
257
I got this error also (see my comment on page 2 or 3 of this thread).

The fault seems to be with Android 1.6. Is that what you have? I just installed tcpdump and run that from adb... works for me.

I also have 1.6
but when I run tcpdump from command line it works.
So the problem can be easily solved on Shark for root.
We just need the developer...
 

ex87

Retired Recognized Developer
Sep 9, 2008
89
49
36
Ventspils
Can You provide working tcpdump executable? I will add option for downloading alternative tcpdump executable.
 

mrmrmrmr

Senior Member
Jan 14, 2007
2,552
257
my tcpdump file is under /system/xbin/tcpdump
maybe ypu should just use the available tcpdump if it is there.

anyway, I attached my tcpdump in this post.
 

Attachments

  • tcpdump.zip
    360.9 KB · Views: 615

Top Liked Posts

  • There are no posts matching your filters.
  • 15
    There were AndroShark, tool for capturing traffic on Android. But there were no newer releases and it seems that original developer dropped project. I liked this tool and used it a lot. But it was set to expire... So there was no simple capture tools available... http://xdaforums.com/showthread.php?t=675206 is home of AndroShark.

    So I made Shark for Root, alternative for AndroShark. Some people asked for possibility to see packets on phone, and for that purpose SharkReader has created (first, "quick and dirty" release).

    Shark for Root

    With tcpdump http://swapper.n3o.lv/lv.n3o.shark_1.0.2.apk
    Native http://swapper.n3o.lv/lv.n3o.sharknative_1.0.2.apk


    SharkReader - unstable...
    (note - run Shark Updater to get traffic analysator)

    http://swapper.n3o.lv/lv.n3o.sharkreader_0.1.6.apk

    Older versions http://swapper.n3o.lv/
    1
    Could someone tell about using different parameters or point me to some website where i could study these?(now i got the defaults)

    And when i open Shark reader i see many "RAW Packet" but i cant get any information from them, just "Packet #number".
    .pcap files are fine when i open them with Wireshark.

    At the bottom i see this: -NULL , what else i can use here and how it effects?

    Interesting app, keep up the good work!:)
    1
    ex87,

    Awesome work bro, life got too busy for me to work more on AndroShark, I really didn't drop it on purpose. But with a busy life, and me still really new at java, it was just too much. I am really glad you picked up the idea and ran with it.

    Do you have any plans to opensource it at all (no worries if you dont)? I would like to be a contributor if you do decide to open source it.

    I really doubt this is of any use. It was the second java app I ever worked on, and was really just a front end. Below is androshark source code. Like I said, this was my second attempt at writing an app, so please don't laugh :) If I were to do it today, I would completely change how it worked. /res/raw/sharktap was just tcpdump.


    Code:
    import java.io.BufferedReader;
    import java.io.File;
    import java.io.FileOutputStream;
    import java.io.InputStream;
    import android.app.Activity;
    import android.app.AlertDialog;
    import android.os.Bundle;
    import android.util.Log;
    import android.view.View;
    import android.widget.Button;
    import android.widget.RadioButton;
    import android.widget.RadioGroup;
    import android.widget.TextView;
    /**
     * ToDo:
     * Check for root
     * Check for first run
     * 		Install Binaries on first run
     * Check for sdcard mount
     * Display file stats
     * Name pcap based on file name
     * Insert License 
     * kill sharktap on die
     * 
     * @author jcase
     *
     */
    
    
    	public class androshark extends Activity implements /*RadioGroup.OnCheckedChangeListener,*/  Button.OnClickListener  {
    		Button btnStart, btnStop;
    		RadioButton radAll, rad3g, radWifi; //http://java.dzone.com/articles/google-android-tutorial?page=0,4
    	    RadioGroup grpRadio;
    	    TextView txtStatus, txtFilename, txtFilesize;
    	    
          
           
    	    
    		/** Called when the activity is first created. */
    		   @Override
    		   
    		   
    		   
    		   public void onCreate(Bundle savedInstanceState) {
    		       super.onCreate(savedInstanceState);
    		        setContentView(R.layout.main);
    		        btnStart = (Button)this.findViewById(R.id.btnStart);
    		        btnStart.setOnClickListener(this);
    		        btnStop = (Button)this.findViewById(R.id.btnStop);
    		        btnStop.setOnClickListener(this);
    		        long epoch = System.currentTimeMillis()/1000;
    
    		        
    		     
    		        boolean exists = (new File("/data/data/net.andirc.androshark/files/sharktap")).exists();
    		        if (exists) {
    		        } else {
    					   Process myproc = null;
    					       try
    					       {
    									     try{
    									    	    String strDirectoy ="/data/data/net.andirc.androshark/files";
    									    	    new File(strDirectoy).mkdir();
    
    									     }
    									     finally {} 
    										 InputStream ins = getResources().openRawResource(R.raw.sharktap);
    										 int size = ins.available();
    										 byte[] buffer = new byte[size];
    										 ins.read(buffer);
    										 ins.close(); 
    										 FileOutputStream fos = new FileOutputStream("/data/data/net.andirc.androshark/files/sharktap");
    										 fos.write(buffer);
    										 fos.close();
    			 
    					       }
    					        
    					       catch (Exception ex)
    					       {
    					               Log.e("yourTag", "Oops something happened: " + ex.getMessage(), ex);
    					       }
    
    					       finally {}
    		        	
    		        }
    		        
    		        boolean exists2 = (new File("/sdcard/androshark/")).exists();
    		        if (exists2) {
    		     
    
    		        } else {
    		        	if (android.os.Environment.getExternalStorageState().equals( 
    		        			android.os.Environment.MEDIA_MOUNTED)) {
    		        	
    					   Process myproc = null;
    				      
    					       try
    					       {
    										 myproc = Runtime.getRuntime().exec(new String[] {"su", "-c","chmod 755 /data/data/net.andirc.androshark/files/sharktap && mkdir /sdcard/androshark/"});					 
    								         	new AlertDialog.Builder(this)  
    										       .setMessage("This is a beta trial version of androshark and will expire on May 15th 2010. This app can potentially consume a lot of sdcard space, depending on how long you allow it to sniff traffic and how much bandwidth you are using.")
    										       .setPositiveButton("OK", null)
    										       .show();
    					       }
    					        
    					       catch (Exception ex)
    					       {
    					               Log.e("yourTag", "Oops something happened: " + ex.getMessage(), ex);
    					       }
    
    					       finally {}
    		        	} else {
    			         	new AlertDialog.Builder(this)  
    					       .setMessage("Error sd01: sdCard not found!")
    					       .setPositiveButton("OK", null)
    					       .show();
    		        	}
    		        }
    		        
    		        if (epoch >= 1273990849) { // May 15th 2010  1273990849
    			      System.exit(0);
    		        } 
    
    	    } 
    		   
    		   
    			public void onClick(View v) {
    				
    			   Process myproc = null;
    		      
    			       try
    			       {
    
    						if (v == btnStart) {
    							if (android.os.Environment.getExternalStorageState().equals( 
    				        			android.os.Environment.MEDIA_MOUNTED)) {
    								
    							
    								 myproc = Runtime.getRuntime().exec(new String[] {"su", "-c", "kill $(ps | grep sharktap | tr -s  ' ' | cut -d ' ' -f2) && /data/data/net.andirc.androshark/files/sharktap -vv -s 0 -w /sdcard/androshark/dump.pcap"});
    
    
    								 
    							        TextView txtStatus = 
    								    (TextView)  this.findViewById(R.id.txtStatus); 
    								    txtStatus.setText("Status: Running"); 
    								        
    							        TextView txtFilename = 
    									(TextView)  this.findViewById(R.id.txtFilename); 
    							        txtFilename.setText("Filename: /sdcard/androshark/dump.pcap"); 
    							        
    							    /*      int running = 1;
    							          do {
    							        	  File file = new File("/sdcard/androshark/dump.pcap");
    											long length = file.length();
    									        TextView txtFilesize = 
    											(TextView)  this.findViewById(R.id.txtFilesize); 
    										    txtFilesize.setText("File Size: " + length/1024 + "KB");
    							          } while (running <= 1); */
    								} else {
    						         	new AlertDialog.Builder(this)  
    								       .setMessage("Error sd02: sdCard not found!")
    								       .setPositiveButton("OK", null)
    								       .show();	
    								}
    							        
    							        
    							 } else if (v == btnStop) {
    				
    								 myproc = Runtime.getRuntime().exec(new String[] {"su", "-c", "kill $(ps | grep sharktap | tr -s  ' ' | cut -d ' ' -f2)"});
    								 myproc.waitFor();
    								 
    								 File file = new File("/sdcard/androshark/dump.pcap");
    								 long length = file.length();
    
    								 
    							        TextView txtStatus = 
    								    (TextView)  this.findViewById(R.id.txtStatus); 
    								    txtStatus.setText("Status: Stopped");
    							        TextView txtFilesize = 
    									(TextView)  this.findViewById(R.id.txtFilesize); 
    							        txtFilesize.setText("File Size: " + length/1024 + "KB");
    							 } 
    
    			       }
    			        
    			       catch (Exception ex)
    			       {
    			               Log.e("yourTag", "Oops something happened: " + ex.getMessage(), ex);
    			       }
    
    			       finally {} 
    		  
    
    
    		}
    		   
    		
    		   
    	}
    1
    Can some please explain in lamon terms what this does? :confused:

    LOL this is nothing like that my friend.. nothing at all

    Apparently you know, and still haven't helped those of us who have no idea what this app is for! :p
    1
    How can I keep the app running even when I have closed the window??
    Is there a way of keeping the application running for like good half an hour in the background so that I can do other things with my phone at the same time??
    It's not possible yet by using only this app, but planning to be on next release (running app as an service).
    Meanwhile you may try some memory optimization applications which can set killing priorities for applications.