Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.

Quiche31

Member Since 28 Oct 2010
Offline Last Active Jan 16 2014 06:27 AM
-----

#9850 Pachube client for NetduinoPlus

Posted by Quiche31 on 19 February 2011 - 05:20 PM

I do see junk moving through the UART. I think it's because I turned flow control off. When I leave it on, after maybe 10 posts, I'd run into what I think is the issue described in the WiFly user manual where the CTS pin gets set to high and I can't move stuff through the UART. I think it's just a matter of finding the right combination of settings.

Quick note: the very first mandatory thing with WiFly, as I learned the hard way, is hardware flow control at this high speed! So please turn it on, and then allow some Thread.Sleep() to allow the WiFly to consume what it needs to absorb. If necessary, attach your standalone test program to your reply

JP


#7870 Webserver on NetduinoPlus + (wired or wireless) library

Posted by Quiche31 on 18 January 2011 - 10:01 PM

Greetings

Posted Image

EDIT: The library has been upgraded to provide web server functionality with either TCP Socket or WiFly shield back-ends. Hence the project can run with either a NetduinoPlus with wired ethernet connectivity, or with a NetduinoPlus and a SFE WiFly shield.

Just like other community members, I wanted to start my home-automation project, namely a web-enabled aquarium controller. One pre-requisite being a wireless connectivity between the aquarium controller and the Wi-Fi router, I started with the attached WiFly driver. Now this small project tests the WiFly driver via an application that turns a Netduino board onto a security Honey Pot: that is a web-application, exposed to the Internet, which emulates the (authentication screen of the) administration console of my Wi-FI router. This Honey Pot is meant to attract hackers trying to break into this pseudo-router, capturing at the same time the username & passwords in use.

Why this odd project? Because my aquarium is meant to be accessible via the Internet, so I wanted to assess the potential for attacks on the web server, and at the same time, test the driver in a fun way. The attached VS-solution contains both the driver and the honey pot, for a Netduino-Plus (I know, it already has an Ethernet plug, but I wanted to start easy before moving everything to my Netduino-Mini, which is the final target).
In the current setting, the only requirements are: a Netduino-Plus with a WiFly shield on-top, a micro-SD for the storage of the log files, and a WiFI router with port-forwarding capability (they all do I would assume).
The steps to follow to build and install the Honey-Pot:

  • In "Program.cs", use the module.Open version that fully specifies the router SSID, passphrase, and port number on which the module will be listening, build and deploy
  • Run the project and verify (in VS log window) that your module correctly joins the router; take note of the DHCP-assigned IP address (192.168.1.3 in the examples below)
  • Test the application locally, from a web-browser. For example: http://192.168.1.3/time should return the default date-time
  • Set the right date/time, for example: http://192.168.1.3/t...cond=0&tz=GMT 1 (note the h24 notation for the hours)
  • View the logs with http://192.168.1.3/log.csv should open an empty Excel spreadsheet (if your SD Card is disfunctioning or absent, this will be indicated there)
  • Authenticate to the HoneyPot with http://192.168.1.3
  • View the log again with http://192.168.1.3/log.csv (should open an Excel spreadsheet with your attempts, displaying username/password that you tried)
  • Clear the logged data on SD Card with http://192.168.1.3/clear
  • Configure your router so that external HTTP request on port (say, 80) are forwarded to your HoneyPot
  • Test your HoneyPot from the Internet, using the Internet-facing your IP address. Note that none of the local capabilities (time, log.csv, clear) should work from the Internet!

Indeed you can modify Program.cs to change the personae of your Honey-Pot. The one that I currently use is my Netgear router; you can change to whatever you feel for!

PS: The whole idea was to test the Http Library, so if you happen to using it for your own needs and had improvements/bug fixes, please let me know!

Attempt to access the Netduino HoneyPot from the Internet (after http://86.68.168.135)
Posted Image

This is how this attempt is logged (notice the username in column C and password in column D) (http://192.168.1.3/log.csv):
Posted Image

Here is how you select between TCP Socket or WiFly implementations:
    .....
    public Program()
    {
        bool wifly = false;
        if (wifly)
            webServer = new HttpWiflyImpl(processRequest, 80, HttpWiflyImpl.DeviceType.crystal_14_MHz, SPI.SPI_module.SPI1, SecretLabs.NETMF.Hardware.NetduinoPlus.Pins.GPIO_PIN_D10);
        else
            webServer = new HttpSocketImpl(processRequest, 80);
        webServer.Listen();
    }

    void processRequest(HttpContext context)
    {
        Boolean redirecting = false;
        String authURL = "/cgi-bin/check_hj.html";
        String tz = "GMT+1";
        String basic = "Basic ";
        String[] keys = { "username", "password" };
        String ip = null;
        String content = "";
        String target = context.Request.Path;

        if (target == "/log.csv")
        {
            StringBuilder sb = new StringBuilder();
            logger.List(sb, keys);
            content = sb.ToString();
            context.Response.ContentType = "text/csv";
        }
        else
        .....
    }
Have fun
Quiche31

EDIT: please note that the library contained in this project is more recent!

Attached Files




home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.