droopescan ModuleNotFoundError: No module named 'cement'

Traceback (most recent call last):

  File "./droopescan", line 3, in <module>

    from dscan import droopescan

  File "/opt/droopescan/dscan/droopescan.py", line 4, in <module>

    from cement.core import backend, foundation, controller, handler

ImportError: No module named cement.core


kali@kali:/opt/droopescan$ sudo pip3 install -r requirements.txt 

[sudo] password for kali: 

Looking in indexes: https://pypi.python.org/simple/

Obtaining file:///opt/droopescan (from -r requirements.txt (line 3))

Collecting cement<2.6.99,>=2.6

  Downloading cement-2.6.2.tar.gz (140 kB)

     |████████████████████████████████| 140 kB 2.7 MB/s 

Collecting futures

  Downloading futures-3.1.1-py3-none-any.whl (2.8 kB)

Collecting pystache

  Downloading pystache-0.5.4.tar.gz (75 kB)

     |████████████████████████████████| 75 kB 536 kB/s 

Requirement already satisfied: requests in /usr/lib/python3/dist-packages (from droopescan==1.42.0->-r requirements.txt (line 3)) (2.23.0)

Building wheels for collected packages: cement, pystache

  Building wheel for cement (setup.py) ... done

  Created wheel for cement: filename=cement-2.6.2-py3-none-any.whl size=81075 sha256=d2626cf569765f2ca2287cc8f6a785bc8ad54d0019b9918284fcc31810745fc6

  Stored in directory: /root/.cache/pip/wheels/4f/5d/82/abbe29539ebb184bfe20f849f1b6267f85ba5fd601f1efaee7

  Building wheel for pystache (setup.py) ... done

  Created wheel for pystache: filename=pystache-0.5.4-py3-none-any.whl size=82928 sha256=993f02ede34c6b06419c6526b59fcbf13b9e8477a042ab3d5b1950d1e14ea3e2

  Stored in directory: /root/.cache/pip/wheels/15/0b/63/b400637eb98976fa7802c507af4f3ced7420c7ebbc191f1eb5

Successfully built cement pystache

Installing collected packages: cement, futures, pystache, droopescan

  Attempting uninstall: droopescan

    Found existing installation: droopescan 1.42.0

    Uninstalling droopescan-1.42.0:

      Successfully uninstalled droopescan-1.42.0

  Running setup.py develop for droopescan

Successfully installed cement-2.6.2 droopescan futures-3.1.1 pystache-0.5.4

netdiscover example

USAGE EXAMPLES


       Scan common LAN addresses on eth0:

           # netdiscover -i eth0

       Fast scan common LAN addresses on eth0 (search only for gateways):

           # netdiscover -i eth0 -f

       Scan some fixed ranges:

           # netdiscover -i eth0 -r 172.26.0.0/24
           # netdiscover -r 192.168.0.0/16
           # netdiscover -r 10.0.0.0/8

Bufferoverflow example

#buff.c #include #include int main(int argc, char* argv[]) { char buf[64]; if(argc<2){ printf("supply atleast one argumnets"); return 1; }else{ strcpy(buf,argv[1]); return 0; } }

Kali Live USB Persistence


fdisk -l
 /dev/sdb # usb drive must be there

#now create a new partition
fdisk /dev/sdb


command 1) n
    2)p
    3)w  # the partition table has been altered



#Lets check
fdisk -l
    /dev/sdb3 "Type" Linux must be created now


now Lets create a file system in new partiion
root@kali:~#mkfs.ext4 -L persistence /dev/sdb3

now make label
    e2label /dev/sdb3 persistence

mkdir -p /mnt/MyDrive
mount /dev/sdb3/mnt/MyDrive

echo "/ union" >  /mnt/MyDrive/persistence.conf

unmount /dev/sdb3
exit

Saving data globally Shared preferences | session management | android

 If we are Storing data in shared preferences will be persistent to all application even after user closes the application. You can save key, value pair data in Shared preferences.


This class contain all user session related functions.
In this class file creating SharedPreferences and inserting / updating / deleting user session data from SharedPreferences.
further explanation given as comment in class code.




Total Files 6 :. 1. Manifest File 2. SessionLoginActivity.java 3. SessionLogoutActivity 4.   5.


1/6. manifest file

<activity android:name=".SessionLoginActivity">
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />

        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
</activity>
 
<activity android:name=".SessionLogoutActivity" /> 


2. SessionLoginActivity.java


package com.example.myapplication;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

public class SessionLoginActivity extends Activity {

    Button btnLogin;

    EditText txtUsername, txtPassword;

    // User Session Manager Class    SessionManager session;

    @Override    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.session_login);

        // User Session Manager        session = new SessionManager(getApplicationContext());

        // get Email, Password input text        txtUsername = (EditText) findViewById(R.id.txtUsername);
        txtPassword = (EditText) findViewById(R.id.txtPassword);

        Toast.makeText(getApplicationContext(),
                "User Login Status: " + session.isUserLoggedIn(),
                Toast.LENGTH_LONG).show();


        // User Login button        btnLogin = (Button) findViewById(R.id.btnLogin);


        // Login button click event        btnLogin.setOnClickListener(new View.OnClickListener() {

            @Override            public void onClick(View arg0) {

                // Get username, password from EditText                String username = txtUsername.getText().toString();
                String password = txtPassword.getText().toString();

                // Validate if username, password is filled                if(username.trim().length() > 0 && password.trim().length() > 0){

                    // For testing puspose username, password is checked with static data                    // username = admin                    // password = admin
                    if(username.equals("admin") && password.equals("learnskill.today")){

                        // Creating user login session                        // Statically storing name="Session Example"                        // and email="aashish.learnskill@gmail.com"                        session.createUserLoginSession("Session Example",
                                "aashish.learnskill@gmail.com");

                        // Starting MainActivity                        Intent i = new Intent(getApplicationContext(), SessionLogoutActivity.class);
                        i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);

                        // Add new Flag to start new Activity                        i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                        startActivity(i);

                        finish();

                    }else{

                        // username / password doesn't match&                        Toast.makeText(getApplicationContext(),
                                "Username/Password is incorrect",
                                Toast.LENGTH_LONG).show();

                    }
                }else{

                    // user didn't entered username or password                    Toast.makeText(getApplicationContext(),
                            "Please enter username and password",
                            Toast.LENGTH_LONG).show();

                }

            }
        });
    }
}

 
 
 
3. SessionLogoutActivity
 
package com.example.myapplication;

import java.util.HashMap;
import android.app.Activity;
import android.os.Bundle;
import android.text.Html;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;

public class SessionLogoutActivity extends Activity {


    // User Session Manager Class    SessionManager session;

    // Button Logout    Button btnLogout;

    @Override    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.session_logout);

        // Session class instance        session = new SessionManager(getApplicationContext());

        TextView lblName = (TextView) findViewById(R.id.lblName);
        TextView lblEmail = (TextView) findViewById(R.id.lblEmail);

        // Button logout        btnLogout = (Button) findViewById(R.id.btnLogout);

        Toast.makeText(getApplicationContext(),
                "User Login Status: " + session.isUserLoggedIn(),
                Toast.LENGTH_LONG).show();



        // Check user login (this is the important point)        // If User is not logged in , This will redirect user to LoginActivity        // and finish current activity from activity stack.        if(session.checkLogin())
            finish();

        // get user data from session        HashMap user = session.getUserDetails();

        // get name        String name = user.get(SessionManager.KEY_NAME);

        // get email        String email = user.get(SessionManager.KEY_EMAIL);

        // Show user data on activity        lblName.setText(Html.fromHtml("Name: " + name + ""));
lblEmail.setText(Html.fromHtml("Email: " + email + ""));
btnLogout.setOnClickListener(new View.OnClickListener() {
@Override public void onClick(View arg0) {
// Clear the User session data // and redirect user to LoginActivity session.logoutUser();
}
});
}
}






4. UserSessionManager.java



 package com.example.myapplication;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;

import java.util.HashMap;

public class SessionManager {

        // Shared Preferences reference        SharedPreferences pref;

        // Editor reference for Shared preferences        Editor editor;

        // Context        Context _context;

        // Shared pref mode        int PRIVATE_MODE = 0;

        // Sharedpref file name        private static final String PREFER_NAME = "AndroidExamplePref";

        // All Shared Preferences Keys        private static final String IS_USER_LOGIN = "IsUserLoggedIn";

        // User name (make variable public to access from outside)        public static final String KEY_NAME = "name";

        // Email address (make variable public to access from outside)        public static final String KEY_EMAIL = "email";

        // Constructor        public SessionManager(Context context){
            this._context = context;
            pref = _context.getSharedPreferences(PREFER_NAME, PRIVATE_MODE);
            editor = pref.edit();
        }

        //Create login session        public void createUserLoginSession(String name, String email){
            // Storing login value as TRUE            editor.putBoolean(IS_USER_LOGIN, true);

            // Storing name in pref            editor.putString(KEY_NAME, name);

            // Storing email in pref            editor.putString(KEY_EMAIL, email);

            // commit changes            editor.commit();
        }

        /**         * Check login method will check user login status         * If false it will redirect user to login page         * Else do anything         * */        public boolean checkLogin(){
            // Check login status            if(!this.isUserLoggedIn()){

                // user is not logged in redirect him to Login Activity                Intent i = new Intent(_context, SessionLoginActivity.class);

                // Closing all the Activities from stack                i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);

                // Add new Flag to start new Activity                i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

                // Staring Login Activity                _context.startActivity(i);

                return true;
            }
            return false;
        }



        /**         * Get stored session data         * */        public HashMap getUserDetails(){

            //Use hashmap to store user credentials            HashMap user = new HashMap();

            // user name            user.put(KEY_NAME, pref.getString(KEY_NAME, null));

            // user email id            user.put(KEY_EMAIL, pref.getString(KEY_EMAIL, null));

            // return user            return user;
        }

        /**         * Clear session details         * */        public void logoutUser(){

            // Clearing all user data from Shared Preferences            editor.clear();
            editor.commit();

            // After logout redirect user to Login Activity            Intent i = new Intent(_context, SessionLoginActivity.class);

            // Closing all the Activities            i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);

            // Add new Flag to start new Activity            i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

            // Staring Login Activity            _context.startActivity(i);
        }


        // Check for login        public boolean isUserLoggedIn(){
            return pref.getBoolean(IS_USER_LOGIN, false);
        }
    }
 
 
 
 
 
 
session_login.xml
 
 
 
 
 
 


 
sessionlogout.xml
 
 
 
 
 
 
 
 5.session_login.xml
 
xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"    android:layout_width="match_parent"    android:layout_height="match_parent"    android:orientation="vertical"    android:padding="10dip">

    <TextView        android:layout_width="fill_parent"        android:layout_height="wrap_content"        android:text="Username (Enter 'admin')"        android:singleLine="true"        android:layout_marginBottom="5dip"/>

    <EditText android:id="@+id/txtUsername"        android:layout_width="fill_parent"        android:layout_height="wrap_content"        android:layout_marginBottom="10dip"/>

    <TextView        android:layout_width="fill_parent"        android:layout_height="wrap_content"        android:text="Password (Enter 'learnskill.today')"        android:layout_marginBottom="5dip"/>

    <EditText android:id="@+id/txtPassword"        android:layout_width="fill_parent"        android:layout_height="wrap_content"        android:layout_marginBottom="20dip"        android:password="true"        android:singleLine="true"/>

    <Button android:id="@+id/btnLogin"        android:layout_width="fill_parent"        android:layout_height="wrap_content"        android:text="Login"/>

</LinearLayout>
 

6. session_logout.xml

 

xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"    android:layout_width="match_parent"    android:layout_height="match_parent"    android:orientation="vertical"    android:padding="10dip">


    <TextView        android:id="@+id/lblName"        android:layout_width="fill_parent"        android:layout_height="wrap_content"        android:singleLine="true"        android:layout_marginTop="40dip"        android:layout_marginBottom="10dip"/>


    <TextView        android:id="@+id/lblEmail"        android:layout_width="fill_parent"        android:layout_height="wrap_content"        android:singleLine="true"        android:layout_marginBottom="40dip"/>


    <Button android:id="@+id/btnLogout"        android:layout_width="fill_parent"        android:layout_height="wrap_content"        android:text="Logout"/>

</LinearLayout>