From ab6c6f7ce5148c547c28c007fb521019cc571763 Mon Sep 17 00:00:00 2001 From: flypatriot Date: Thu, 21 Mar 2019 09:39:06 -0400 Subject: [PATCH 1/4] SearchSploit Not Working After Update fix --- src/com/offsec/nethunter/SearchSploitSQL.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/com/offsec/nethunter/SearchSploitSQL.java b/src/com/offsec/nethunter/SearchSploitSQL.java index 01ad257..8328047 100644 --- a/src/com/offsec/nethunter/SearchSploitSQL.java +++ b/src/com/offsec/nethunter/SearchSploitSQL.java @@ -29,7 +29,7 @@ class SearchSploitSQL extends SQLiteOpenHelper { } public void onCreate(SQLiteDatabase database) { - String CREATE_SEARCHSPLOIT_TABLE = "CREATE TABLE IF NOT EXISTS " + SearchSploit.TABLE + + String CREATE_SEARCHSPLOIT_TABLE = "CREATE TABLE IF NOT EXISTS " + SearchSploit.TABLE + " (" + SearchSploit.ID + " INTEGER PRIMARY KEY, " + SearchSploit.FILE + " TEXT," + SearchSploit.DESCRIPTION + " TEXT," + @@ -37,7 +37,7 @@ public void onCreate(SQLiteDatabase database) { SearchSploit.AUTHOR + " TEXT," + SearchSploit.PLATFORM + " TEXT," + SearchSploit.TYPE + " TEXT," + - SearchSploit.PORT + " INTEGER)"; + SearchSploit.PORT + " INTEGER DEFAULT 0)"; database.execSQL(CREATE_SEARCHSPLOIT_TABLE); database.disableWriteAheadLogging(); } @@ -58,7 +58,9 @@ public void doDrop() { Boolean doDbFeed() { // copy csv to /sdcard as temp (so we can read it) - String _cmd = "su -c bootkali custom_cmd csv2sqlite.py /usr/share/exploitdb/files.csv /sdcard/nh_files/SearchSploit " + SearchSploit.TABLE; + String _cmd = "su -c bootkali\n" + "csv2sqlite.py /usr/share/exploitdb/files_exploits.csv SearchSploit " + SearchSploit.TABLE + "\n" + + "sqlite3 SearchSploit 'UPDATE " + SearchSploit.TABLE + " SET " + SearchSploit.PORT + " = 0 WHERE " + SearchSploit.PORT + " IS NULL;'\n" + + "mv SearchSploit /sdcard/nh_files/SearchSploit\n"; // move to app db folder exe.RunAsRootOutput(_cmd); return true; @@ -118,8 +120,8 @@ private List createExploitList(Cursor cursor) { _exploit.setDescription(cursor.getString(2)); // desc _exploit.setDate(cursor.getString(3)); // date _exploit.setAuthor(cursor.getString(4)); // author - _exploit.setPlatform(cursor.getString(5)); // platform - _exploit.setType(cursor.getString(6)); // type + _exploit.setType(cursor.getString(5)); // type + _exploit.setPlatform(cursor.getString(6)); // platform _exploit.setPort(cursor.getInt(7)); // port commandList.add(_exploit); } while (cursor.moveToNext()); From 483b4e87205bc696232a96e47ef07751ac9a370d Mon Sep 17 00:00:00 2001 From: flypatriot Date: Fri, 22 Mar 2019 03:10:41 -0400 Subject: [PATCH 2/4] Change unreadable text colours --- res/layout/custom_commands_item.xml | 12 +++---- res/layout/custon_commands_dialog.xml | 43 ++++++++++++---------- res/layout/searchsploit_item.xml | 51 ++++++++++++++------------- 3 files changed, 58 insertions(+), 48 deletions(-) diff --git a/res/layout/custom_commands_item.xml b/res/layout/custom_commands_item.xml index 74edabf..08ae6b8 100644 --- a/res/layout/custom_commands_item.xml +++ b/res/layout/custom_commands_item.xml @@ -44,16 +44,16 @@ android:layout_alignParentStart="true" />