Jump to content

wiregr

Active Members
  • Posts

    10
  • Joined

  • Last visited

  • Days Won

    2

Posts posted by wiregr

  1. Thanks for the guide but i have a BIG question which is if we have TCPDUMP running on br-lan and using a CIFS share to store logs and fetching fun files, all that traffic will be logged to the pcap file which will make it bloat, i might target wlan0 for the TCPDUMP to avoid this, right?

    This also gives me a nice idea of not hooking a usb storage device to the pineapple and using a different IP storage and mount it as /USB.

    Does the CIFS shares mount fast after boot up or there is a wait time?

    This is an excellent point. I haven't done a ton of testing, so this is mostly proof-of-concept for now. I would imagine you could tell tcpdump not to include the samba ports for the server ip address (quick google search returns that you can start tcpdump via: tcpdump -i eth1 port not 22 and host 1.2.3.4 to exclude ports for a single ip address).

    Edit: Forgot to mention, it looks like samba uses ports 139 and 445 (nmbd uses 137, 138, so might want to block those as well if you're still seeing additional traffic).

  2. So for this how-to, I'm going to walk you through how to install the necessary packages to connect to a CIFS/Samba server from your pineapple.

    First, you'll need the following packages:

    You can download them all individually, or grab an archive with everything here: cifs-packages.tgz

    Just like I mentioned in the Android how-to, these packages are available on the OpenWRT package repository, but they're built against a newer kernel than the pineapple is running (3.3.8 as of this writing, compared to the pineapple's 3.2.14). I checked out an older version of the OpenWRT source (revision 31222 if anyone wants to try this out themselves) and built the necessary packages myself.

    Okay, so to install everything, copy all of the ipk files over to the pineapple's /tmp directory. Install them all using the following commands (the order shouldn't matter as we're using nodeps, but if you run each command first without it, the only complaint should be that the kernel hash doesn't match exactly)

    opkg --nodeps install /tmp/kmod-crypto-manager_3.2.14-1_ar71xx.ipk
    opkg --nodeps install /tmp/kmod-crypto-hmac_3.2.14-1_ar71xx.ipk
    opkg --nodeps install /tmp/kmod-crypto-hash_3.2.14-1_ar71xx.ipk
    opkg --nodeps install /tmp/kmod-crypto-des_3.2.14-1_ar71xx.ipk
    opkg --nodeps install /tmp/kmod-crypto-ecb-1_ar71xx.ipk
    opkg --nodeps install /tmp/kmod-crypto-md4_3.2.14-1_ar71xx.ipk
    opkg --nodeps install /tmp/kmod-crypto-md5_3.2.14-1_ar71xx.ipk
    opkg --nodeps install /tmp/kmod-fs-cifs_3.2.14-1_ar71xx.ipk
    

    Once everything is installed, you can connect to a samba share with the command:

    mkdir /mnt/test
    mount -t cifs //server/share /mnt/test -o user=username,password=password

    Where server is the server ip, share is the name of the shared folder on the server, /mnt/test is the directory on the pineapple where you want the share mounted, and user and password are, well, your username and password ;)

    Let me know if anyone has any problems and I'll try to help out, otherwise, enjoy!

    (Edit: removed some bad formatting)

  3. This sounds great! My contract is running out, and now I know what to do with my old, rooted Desire! :lol:

    Since this is included in the firmware now, are the steps in the original post still necessary? Or is it just a case of connecting one's phone and ensuring development mode is enabled?

    Also, is there any news on the SD card access? Otherwise, where do I store logs and so on?

    Many thanks - awesome work as ever.

    Actually, yeah, I was able to get SD card access working although I haven't done much testing other than verifying that I could see files, read, and write to the phone. Basically, I built the necessary kernel modules needed to get cifs working on the pineapple, and then hijacked a bit of the functionality of the "Samba Filesharing" program on my phone to get it to share over the USB tether interface (rndis0) instead of over wifi. I'll write up some step-by-step instructions when I get home this afternoon

    Also as it turns out, the small, powered USB hub that came with the original Rock Band works wonderfully with the pineapple. It's just the right size (pretty small) and the USB->DC plug that came with my external battery fits it. This is probably a better solution as you can leave the USB hub connected and automatically mount a dedicated USB stick when the pineapple boots instead of having to manually set everything up each time.

  4. Okay, so this is the second time that my post has been deleted (this time alongside a post from someone saying they saw the first). Can somebody explain if I'm doing something wrong or violating a rule here? Should I not be posting the .config file, or is there a problem because I put it up on pastebin? I'd really like to know what I was doing wrong so I can avoid it in the future.

  5. So the wife's phone also uses Media Transfer Protocol to share files with PC too which makes things a bit more complicated. I want to say that if you have an android phone that uses the normal USB Mass Storage mode (i.e. connecting your phone to a PC makes the SD card contents unavailable on the phone) that it wouldn't be too hard, but I can't say for sure.

    As far as MTP support goes, I'll see if I can find a workaround. I found a filesystem implementation that sounds promising, but I'm concerned about some of the functionality, namely that "libmtp (and I assume the MTP protocol itself) doesn’t support seeking within a file or partial file reads or writes. You have to fetch or send the entire file" - from this site.

    Maybe using some program that allows for file sharing on the android (something like android fileshare) would work?

  6. Excellently done! Can't wait to try it out!

    :::Picks up phone to call friendly Nexus owner down the street:::...

    Edit: Did you make any attempts at mounting the microSD storage for use on the pineapple? That would surely be total win!

    telot

    I haven't tried on the nexus, since there's only internal storage and it's setup as MTP instead of USB mass storage so I think it's a little more involved to get it mounted. I'll do some more research and see if I can figure anything out.

    With a regular phone with a microsd card it might be a little easier. If I have time today I'll try it out with my wife's phone and report back.

    Edit: I accidentally a word

  7. I managed to get my MK4 pineapple to successfully connect to the internet through my Android phone and thought I would share the steps for anyone who's interested. I've tested this on a fresh MK4 Pineapple (firmware 2.0) using a Google Nexus running CyanogenMod9. I'm not sure if this will work with other tethering software like PDAnet.

    After looking around on google, it seems that in order to get an openwrt router to connect via android tether, the only real packages we need that aren't already installed on the Pineapple are:

    • kmod-usb-net
    • kmod-usb-net-cdc-ether (depends on kmod-usb-net)
    • kmod-usb-net-rndis (depends on kmod-usb-net, kmod-usb-net-cdc-ether)

    The official openwrt package repo has these, but they're all built against kernel 3.3.7 which is too new (pineapple firmware 2.0 went out with 3.2.14), so I checked out an older revision of the openwrt source tree and packages (revision 31222 which used the correct kernel version) and built what was missing. After copying them over to the pineapple and installing using opkg, the pineapple detected my phone just fine and was able to pull down an ip and connect to the internet.

    So here's a step-by-step:

    1. Download the missing packages and copy them over to your pineapple (/tmp in this example)
    2. Run the following commands in this order:
      opkg --nodeps install /tmp/kmod-usb-net_3.2.14-1_ar71xx.ipk
      opkg --nodeps install /tmp/kmod-usb-net-cdc-ether_3.2.14-1_ar71xx.ipk
      opkg --nodeps install /tmp/kmod-usb-net-rndis_3.2.14-1_ar71xx.ipk


    3. Reboot the pineapple (not sure if this is necessary)
    4. Connect your android phone to the pineapple via USB
    5. Turn on USB tethering
    6. On the pineapple, run dmesg and verify that usb0 shows up
    7. Add the following to /etc/config/network (This ensures that usb0 will obtain an ip via dhcp):
      config interface usb
          option ifname usb0
          option proto dhcp


    8. Restart pineapple again, enable tethering in android again.

    At this point, ifconfig usb0 should show that usb0 has automatically obtained a valid ip address and you should be able to ping out to the internet.

    Now that it's working, you'll still need to setup ip forwarding to properly forward traffic from clients to/from the usb:

    iptables -t nat -A POSTROUTING -s 172.16.42.0/24 -o usb0 -j MASQUERADE
    iptables -A FORWARD -s 172.16.42.0/24 -o usb0 -j ACCEPT
    iptables -A FORWARD -d 172.16.42.0/24 -m state --state ESTABLISHED,RELATED -i usb0 -j ACCEPT

    At this point, you should be able to connect to the pineapple and browse the internet as usual. Tested with urlsnarf and everything seemed to be working properly :) If anyone's interested, I can post a step-by-step so you can build everything yourself.

    Here are the package files I used:

    kmod-usb-net_3.2.14-1_ar71xx.ipk

    kmod-usb-net-cdc-ether_3.2.14-1_ar71xx.ipk

    kmod-usb-net-rndis_3.2.14-1_ar71xx.ipk

    Anyways, let me know if you have any questions. I've been a lurker for a while and I wanted to try and contribute for once :D

×
×
  • Create New...