Skip to content
This repository has been archived by the owner on Apr 25, 2019. It is now read-only.

Commit

Permalink
Merge pull request #1 from flypatriot/2019.2
Browse files Browse the repository at this point in the history
Merge changes
  • Loading branch information
kimocoder authored Mar 27, 2019
2 parents 0caf91a + 2855ce3 commit cb1759d
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 53 deletions.
12 changes: 6 additions & 6 deletions res/layout/custom_commands_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,16 @@
android:layout_alignParentStart="true" />

<Button
android:id="@+id/runCommand"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Run"
android:id="@+id/runCommand"
android:layout_marginRight="@dimen/base_listItem_LR"
android:layout_marginTop="@dimen/base_listItem_LR"
android:textColor="#ff95ff84"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true" />
android:layout_alignParentEnd="true"
android:layout_marginTop="@dimen/base_listItem_LR"
android:layout_marginRight="@dimen/base_listItem_LR"
android:text="Run"
android:textColor="@android:color/holo_blue_dark" />

<TextView
android:layout_width="wrap_content"
Expand Down
43 changes: 25 additions & 18 deletions res/layout/custon_commands_dialog.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="wrap_content" android:padding="10dp"
android:weightSum="1">
Expand All @@ -19,13 +20,16 @@
android:layout_height="wrap_content"
android:text="@string/add_lauchner_btn_label"

android:textAppearance="?android:attr/textAppearanceLarge" />
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="@android:color/white" />

<EditText
android:id="@+id/editText_launcher_btn_label"
android:layout_width="match_parent"

android:layout_height="wrap_content" >
android:layout_height="wrap_content"
android:textColor="@android:color/white">

<requestFocus />
</EditText>

Expand All @@ -34,45 +38,47 @@
android:layout_height="wrap_content"

android:text="@string/add_lauchner_btn_command"
android:textAppearance="?android:attr/textAppearanceLarge" />
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="@android:color/white" />

<EditText
android:id="@+id/editText_launcher_command"
android:layout_width="match_parent"

android:layout_height="wrap_content"
android:layout_marginBottom="10dp"/>
android:layout_marginBottom="10dp"
android:textColor="@android:color/white" />

<RelativeLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
>

<TextView
android:id="@+id/run_in_shell_text"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="Send to:"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_above="@+id/add_lauchner_btn_execmode_text"
android:layout_alignEnd="@+id/add_lauchner_btn_execmode_text"
android:layout_alignParentStart="true"
android:layout_alignEnd="@+id/add_lauchner_btn_execmode_text" />



android:text="Send to:"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="@android:color/white" />


<TextView
android:id="@+id/add_lauchner_btn_execmode_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Exec mode: "
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_gravity="center_vertical"
android:layout_alignTop="@+id/spinnerExecMode"
android:layout_alignParentStart="true"
android:layout_gravity="center_vertical"
android:paddingTop="5dp"
android:text="Exec mode: "

android:layout_alignParentStart="true" />
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="@android:color/white" />
<Spinner
android:id="@+id/spinnerRun_in_shell"
android:layout_width="wrap_content"
Expand Down Expand Up @@ -102,13 +108,14 @@
android:layout_height="match_parent">

<TextView
android:id="@+id/textView10"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Run at boot:"
android:id="@+id/textView10"
android:layout_alignParentStart="true"
android:layout_alignParentBottom="true"
android:layout_alignParentStart="true" />
android:text="Run at boot:"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="@android:color/white" />

<CheckBox
android:layout_width="wrap_content"
Expand Down
51 changes: 27 additions & 24 deletions res/layout/searchsploit_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,22 @@
android:layout_height="match_parent"
android:longClickable="true"
android:paddingBottom="5dp">

<TextView
android:id="@+id/description"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="description"
android:id="@+id/description"
android:paddingLeft="@dimen/base_listItem_LR"
android:paddingRight="@dimen/base_listItem_LR"
android:layout_alignParentTop="true"
android:layout_alignParentStart="true"
android:gravity="center_vertical"
android:layout_marginBottom="18dp"
android:layout_alignParentTop="true"
android:layout_marginTop="18dp"
android:layout_toStartOf="@+id/searchsploit_sendhid_button" />
android:layout_marginBottom="18dp"
android:layout_toStartOf="@+id/searchsploit_sendhid_button"
android:gravity="center_vertical"
android:paddingLeft="@dimen/base_listItem_LR"
android:paddingRight="@dimen/base_listItem_LR"
android:text="description"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="@android:color/white" />

<TextView
android:layout_width="wrap_content"
Expand Down Expand Up @@ -53,16 +55,17 @@
android:paddingRight="@dimen/base_listItem_LR"
android:layout_below="@+id/textView9"
android:layout_alignParentStart="true" />

<Button
android:id="@+id/viewSource"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="View Source"
android:id="@+id/viewSource"
android:layout_marginRight="@dimen/base_listItem_LR"
android:textColor="#ff95ff84"
android:layout_below="@+id/searchsploit_sendhid_button"
android:layout_alignStart="@+id/openWeb" />
android:layout_alignStart="@+id/openWeb"
android:layout_marginRight="@dimen/base_listItem_LR"
android:text="View Source"
android:textColor="@android:color/holo_blue_dark" />

<TextView
android:layout_width="wrap_content"
Expand Down Expand Up @@ -115,25 +118,25 @@
android:layout_alignStart="@+id/author" />

<Button
android:id="@+id/openWeb"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="View in www"
android:id="@+id/openWeb"
android:layout_marginRight="@dimen/base_listItem_LR"
android:textColor="#ff95ff84"
android:layout_below="@+id/viewSource"
android:layout_alignParentEnd="true" />
android:layout_alignParentEnd="true"
android:layout_marginRight="@dimen/base_listItem_LR"
android:text="View in www"
android:textColor="@android:color/holo_blue_dark" />

<Button
android:id="@+id/searchsploit_sendhid_button"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="SEND HID"
android:textColor="#ff95ff84"
android:id="@+id/searchsploit_sendhid_button"
android:layout_alignParentTop="true"
android:layout_alignStart="@+id/viewSource"
android:layout_alignEnd="@+id/viewSource" />
android:layout_alignEnd="@+id/viewSource"
android:layout_alignParentTop="true"
android:text="SEND HID"
android:textColor="@android:color/holo_blue_dark" />

</RelativeLayout>
12 changes: 7 additions & 5 deletions src/com/offsec/nethunter/SearchSploitSQL.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ 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," +
SearchSploit.DATE + " TEXT," +
SearchSploit.AUTHOR + " TEXT," +
SearchSploit.PLATFORM + " TEXT," +
SearchSploit.TYPE + " TEXT," +
SearchSploit.PORT + " INTEGER)";
SearchSploit.PORT + " INTEGER DEFAULT 0)";
database.execSQL(CREATE_SEARCHSPLOIT_TABLE);
database.disableWriteAheadLogging();
}
Expand All @@ -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;
Expand Down Expand Up @@ -118,8 +120,8 @@ private List<SearchSploit> 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());
Expand Down

0 comments on commit cb1759d

Please sign in to comment.