yashsingh1/xdaforums huggingface dataset:
[Android Software/Hacking General [Developers Only]] joschi70:
The version of PAW used for the PrirateBox is a "normal" PAW server with exchanged html content and a changed upload limit setting.

All the rest is PAW as it is available in the Android Market. PAW allows developers to develop dynamic web pages.

This also allows for sending SMS and the like. But non of this (except for Internet and write to local fileysystem permissions) is used in the PirateBox version.

All the scripts that are executed are available in plain text in the /sdcard/paw/etc/init/1 and /sdcard/paw/html directories.

If you don't trust the APK itself turn on your network sniffers. PAW only opens a port and waits for incoming connections.

By the way ... I think that you should no have sensitive data on a PirateBox. It shouldn't even have Internet connectivity.
[Android Software/Hacking General [Developers Only]] olitask:
Thank you for your reply. I trust you , but I was thinking of the possibility to send by phone the list of the piratebox files , your name and your GPS position.

I try it, it's ok , I will use it , but without any SIMcard in my phone !

Bye Oliver
[Android Software/Hacking General [Developers Only]] B00n241:
Redirect?

Hey guys, first of all thank you very much for this breathtaking project.

But...I've got a single question: shouldnt all clients be redirected to my piratebox, even if they visit google or sth like this? If it should be that way, it doesn't work for me :D

When I visit h.ttp://#Paw IP everything works fine, but its kind of unhandy to type the whole IP...

To my specs I've got a Desire HD Miui Rom1.2.4 CWM 2.5.3, but i don't really know what to modify in which way...

Thanks in advance and sorry for my (stupid?) question,

B00n241
[Android Software/Hacking General [Developers Only]] joschi70:
There are no stupid question ;)

With my setup alle DNS queries are answered with the phone's IP.

I use WiFi Tether 2.0.2-pre13 (the only version that worked for me).

The startup scripts adds the following line to the /data/data/android.tether/conf/dnsmasq.conf configuration file:

address=/#/<Phone's IP address>

This causes all DNS requests to be answered with the IP address of the phone.

Try to install the same WiFi Tether version, it might work.
[Android Software/Hacking General [Developers Only]] pspunderground:
It's a problem with native WiFi tethering. ROMS with native tethering won't work with this.
[Android Software/Hacking General [Developers Only]] afclewis:
Struggling

Hi there,

I'm trying to get your amazing piratebox working but am struggling with getting the forwarding to work.

I think the problem is that i am running 2.1 on an x10 and wifi tether says it wont run properly because the rom is wrong. When i try running it i get "Enabling NAT rules......failed"

Oddly the paw server works a treat if i type in the ipaddress, but the forwarding just hangs.

Any help would be much appreciated.

Is it possible to use paw with barnacle tether (which works on the x10)

well done with all the work you've done, its a brilliant project and i am really looking forward to it running it everywhere i go.
[Android Software/Hacking General [Developers Only]] joschi70:
I couldn't get Barnacle to run on my Galaxy, so I can't tell if the setup would work the same way as with WiFi Tether.

PAW will run independent of the tether solution. The only problem might be the startup script.

Two thing are done by the startup scripts:

Answer all DNS requests with the IP address of the phone (using dnsmasq).

Redirect the port 80 to port 8080 (using iptables).

Dnsmasq and iptables come with WiFi Tether, so if these also come with Barnacle, there should not be a problem. In this case it shoul only be necessary to adjust the path names in the PAW startup script (/sdcard/paw/etc/init/1/S_piratebox_startup.bsh).

Currently the startup script looks like this:

import de.fun2code.android.pawserver.util.*;

source("/sdcard/paw/bsh/pb_functions.bsh");

ip = Utils.getLocalIpAddress();

if(ip != null) {
network = "eth0";
dnsmasqConf = "/data/data/android.tether/conf/dnsmasq.conf";
dnsmasqPid = "/data/data/android.tether/var/dnsmasq.pid";

String[] dnsMasqCmds = new String[] {
"cp " + dnsmasqConf + " /sdcard/paw/tmp/dnsmasq.conf_ORG",
"cp " + dnsmasqConf + " /sdcard/paw/tmp/dnsmasq.conf",
"echo \"address=/#/" + ip + "\" >> /sdcard/paw/tmp/dnsmasq.conf",
"cp /sdcard/paw/tmp/dnsmasq.conf " + dnsmasqConf,
"cat " + dnsmasqPid + " | xargs kill",
"/data/data/android.tether/bin/dnsmasq -i " + network +" "+ "--resolv-file=/data/data/android.tether/conf/resolv.conf " + "--conf-file=" + dnsmasqConf
};
String[] iptablesAddCmds = new String[] {
"/data/data/android.tether/bin/iptables -t nat -A PREROUTING -i eth0 -d " + ip + " -p tcp --dport 80 -j DNAT --to " + ip + ":8080"
};

execRootShell(dnsMasqCmds);
execRootShell(iptablesAddCmds);
}
[Android Software/Hacking General [Developers Only]] afclewis:
No joy trying to re write for barnacle wifi, to be honest my knowledge of coding for android means I could be making a stupid mistake or it could mean barnacle needs a lot of extra work. I just don't know, but will keep watching this thread and if you manage to get it working for barnacle will be singing your praises forever.
[Android Software/Hacking General [Developers Only]] Kazer2.0:
Test on the latest Cyanogen Mod for Samsung Galaxy Spica.

Paw server work (but need to restore default config, Otherwise the app crash). Wireless Tether for Root Users work, but the forwarding doesn't work, I need to write the ip adresse (192.168.2.254:8080) Manually to acces on the piratebox, If a write google, I acces to google, not redirected to the piratebox

(Sorry for my bad english)
[Android Software/Hacking General [Developers Only]] mobrob:
Anybody have the html for the index with chat? or know of a html chat that could be embedded? Would really like the chat feature also if you edit \paw\html\index.html you can personalize it. I added a couple of personal links. troubles with html. try the compose feature in Seamonkey and its like Microsoft Word
[Android Software/Hacking General [Developers Only]] pspunderground:
I'll try to implement chat in the next few days.
[Android Software/Hacking General [Developers Only]] wand3r0r:
is this project abandoned?

sorry, not abandoned. but i'm having the exact same issues as kazer2.0 only on an EVO 4G
[Android Software/Hacking General [Developers Only]] Keegs1:
Same as above, I can go to Piratebox but only through the IP it shows on Screen, it doesn't forward all requests to it.

Droid X
[Android Software/Hacking General [Developers Only]] romis138:
// Will this server (android version of PirateBox) have the chat web portal built in?

// If I attach massage storage, will it auto recognize, or only share from internal micro/sd?

// Battery packs..? Any recommendations for these, are they just USB mini/micro tethered battery packs or something?

Came here from the David Darts' PirateBox DIY main page. Thanks.
[Android Software/Hacking General [Developers Only]] oloco2:
¿get_file.xhtml?

Hi! This is my first post.

I really like the idea of pirate box, and I'm trying to use it on a Android with Cyanogen 7.

My problem is that when I trie to download a file from the mobile browser, it always download the files with the name get_file.xhtml

I have tried with some photos, and they are opened directly in the web browser... but the other kind of data (like music and other extensions) always download with the name get_file.xhtml...

I have attached the file get_file.xhtml and index.html (both in txt extension) from the PAW directory from the phone.

Any ideas?

Thank You very much!!
[Android Software/Hacking General [Developers Only]] joschi70:
Try to change the following lines from get_file.xhtml from:

if(mime.equals("application/octet-stream")) {
request.responseHeaders.put("Content-disposition", "attachment; filename=\"" + fileName + "\"");
}

to:

request.responseHeaders.put("Content-disposition", "attachment; filename=\"" + fileName + "\"");

That might help, but I haven't tried.
[Android Software/Hacking General [Developers Only]] -juanito-:
PirateBox ?? what thats mean ??

What we will benefit from this method ؟؟
[Android Software/Hacking General [Developers Only]] oloco2:
Hi joschi70 !

Tried erasing the lines below and above and still having the same problem (restarting the phone).

Any other idea?

Thanks a lot!
[Android Software/Hacking General [Developers Only]] joschi70:
Hi oloco2 ,

not really :(

What you could try is the following (but might not work):

mime = "application/octet-stream";
request.responseHeaders.put("Content-disposition", "attachment; filename=\"" + fileName + "\"");

Bye

Jochen
[Android Software/Hacking General [Developers Only]] oloco2:
Not working... after editting the file, I restart the service and it fails, so I can not start it.

:(
[Android Software/Hacking General [Developers Only]] joschi70:
Hi oloco2,

changing the file should not prevent the service from starting.

Bye

Jochen
[Android Software/Hacking General [Developers Only]] oloco2:
You are right... the service is running again. Maybe it was a temporal failure....

Anyway, i changed the file as you said, but still the same problem...
[Android Software/Hacking General [Developers Only]] romis138:
How do I submit debug information? I can't launch on CM6 on a MytouchSlide3G,

Does anyone have a ROM recommendation with the MTS3G that's compatible with DropBox?
[Android Software/Hacking General [Developers Only]] danielblakes:
:/

specs:

g1

cm6.1

wireless tether 2.0.7

paw as linked at the beginning of the thread.

everything works flawlessly, except the redirection.

i am currently muddling around in the config settings myself, but any guidance would be appreciated.

i will try flashing the stock g1 rom (rooted of course) and see if that is the problem.

stay tuned.
[Android Software/Hacking General [Developers Only]] pspunderground:
Does CM6 have native wifi tethering?
[Android Software/Hacking General [Developers Only]] Bohemus:
I use CM7 and have been unable to get this to work, most likely because of the native tethering. Is there a workaround for ROM's like CM7 that have native tethering?
[Android Software/Hacking General [Developers Only]] Keegs1:
Still no response from the Dev or a Fix, makes me really sad.

Specs:

Droid X

Android Version: 2.2.1

System Version: 2.3.340.MB810.Verizon.en.US

Jailbroken, only works when using direct IP:Port given, does not redirect other requests still.
[Android Software/Hacking General [Developers Only]] joschi70:
Sorry, but the only rooted phone I have is my old Galaxy.

So I can't test with CM7 or other ROMs.
[Android Software/Hacking General [Developers Only]] Keegs1:
Well if there's any other information you need I'd be glad to help.

Would be a really wonderful app to share with everyone, although I understand how hard it can be to debug for other devices.
[Android Software/Hacking General [Developers Only]] joschi70:
You can try it yourself by using the shell on your Android device.

Things that are important are:

Try to find a way to respond to all DNS requests with the IP of your device.

Redirect port 80 to 8080.

On my Galaxy I have done the following:

All DNS requests have to be answered with the IP of your Android Hotspot. In the WiFi Tethering case dnsmasq is used for this.

All HTTP traffic to port 80 has to be forwarded to port 8080 (using iptables), because PAW can not run on privileged ports.

After this works on the shell, the commands in the PAW startup script can be adjusted.

Hope that helps and you'll find a solution.
[Android Software/Hacking General [Developers Only]] Keegs1:
-snip-

10 characters.
[Android Software/Hacking General [Developers Only]] shalkith:
Any idea why I would randomly get FC on the Paw server? It worked for about 20 mins then started FCing on me :-\

HTC EVO3d - CM7
[Android Software/Hacking General [Developers Only]] Keegs1:
I had that aswell after changing my server.xml

Replace Pawserver's server.xml with this one

dl.dropbox.com/u/2149114/filehost/sept/server%20%281%29(dot)xml

xml should be located in something like:

data/data/paw server/conf

I think
[Android Software/Hacking General [Developers Only]] shalkith:
I ended up uninstalling the app - deleting the /paw directory on my SD card then re-installed it. That did the trick :)
[Android Software/Hacking General [Developers Only]] wand3r0r:
FC

Paw only seems to FC as a self destruct mechanism to prevent tampering. no need to uninstall to fix just clear data. under settings>applications>manage applications then find Paw, tap to select the tap clear data. There always seems to be 4kb to clear
[Android Software/Hacking General [Developers Only]] wand3r0r:
It Works!

I'm sorry for not believing in you! If you are having trouble with the reditect make sure you are using Wireless Tether 2.02. Being a new user I'm not allowed to post a link but it's not hard to find. It's also mildly outdated so it's not on the market. Here is the link => goo.gl/Aabkk
[Android Software/Hacking General [Developers Only]] skimmas:
Problem with iptables

Hey.

My device is a huawey ideos x5 and the only version of wifi tether I can run on my device is wifi_tether_v3_1-beta6 (from google code)

I tried to adapt the scripts to work in this version but I think the iptables config is not right. Can anyone give me a hand?

the output from /data/data/com.googlecode.android.wifi.tether/bin/iptables --list -t nat is:

getsockopt for multiport failed strangely: No such file or directory

getsockopt for multiport failed strangely: No such file or directory

Chain PREROUTING (policy ACCEPT)

target prot opt source destination

FIX ME! implement getprotobynumber() bionic/libc/bionic/stubs.c:384

FIX ME! implement getnetbyaddr() bionic/libc/bionic/stubs.c:372

DNAT tcp -- anywhere 192.168.1.75 tcp dpt:www to:192.168.1.75:8080

Chain POSTROUTING (policy ACCEPT)

target prot opt source destination

Chain OUTPUT (policy ACCEPT)

target prot opt source destination
[Android Software/Hacking General [Developers Only]] septavios:
I am trying to build my own paw server web app,novice programmer.

I would i like to ask if anyone know what api is inside this package

"de.fun2code.android.pawserver"
[Android Software/Hacking General [Developers Only]] joschi70:
Got it running with the stock tether app on my Notion Ink Adam.

I've posted about it on my blog. The post also describes the technical details and the plugin installation.

Here is the blog post: PirateBox on Android

Hope that helps in setting up a PirateBox...

Update:

Since version 0.3 of the plugin, PirateBox is also working on rooted Galaxy Nexus devices running Ice Cream Sandwich.
[Android Software/Hacking General [Developers Only]] chriscx:
awesome, thank you so much
[Android Software/Hacking General [Developers Only]] Fusio9:
Desire with Runnymede, seems to be working. I am impressed. Very cool :)

What about the shoutbox? :P

EDIT:

lol.. probably adding all these zeros wasn't a good idea after all ;) max int on Android is 2147483647.. you should change the value on server file..

EDIT2:

I just noticed the first post was last updated 1 year ago. WAT. I guess we should disregard this apk and just use the v0.3 of the plugin. Right?

EDIT3:

mh. either I am doing something wrong, or the plugin version (0.3) doesn't work for me.

Steps:

download PAW apk from market

install plugin (it says it creates the AP, but it doesn't..)

start WifiTether

start PAW

I connect to the AP and nothing happens, browser is not forwarding either.

EDIT4:

I ended up using the old APK and hacking the paw/html folder to use the v0.3 html files.. I decided to use a folder called 'piratebox' instead of 'uploads'.. but that's it. really ugly solution until I'll menage to make the plugin work :P

(html folder attached.. for anyone using the APK provided in the first post, just install it and then override the html folder with this one.. should work with shoutbox, too)

btw. I noticed that stopping the server causes the uploaded files to get corrupted.. no idea why..
[Android Software/Hacking General [Developers Only]] Wesleywarrior:
That hack is the best thing working on my rooted T-mobile rapport so far, I've finally got chatbox but I still have to enter the ip manually...
[Android Software/Hacking General [Developers Only]] InsightGoalie:
Is it possible to have all network traffic forwarded to the correct site? For instance, can I forward a request for Google.com to the proper 192.168.x.x:8080? This would be useful as I really doubt a majority of people would know where to go to get to the site. I would like to see what happens when you give people the ability to stumble upon it and see if they use it.

Nevermind, I was able to get it working by just installing PAW server and then adding the piratebox plug in. Works much better than this method.
[Android Software/Hacking General [Developers Only]] InsightGoalie:
Is the maxPost in bytes?
[Android Software/Hacking General [Developers Only]] Fusio9:
What ROM/Device are you on?

With HTC Desire and a Sense based (gingerbread) Rom it doesn't work.

I am installing the PAW server, downloading unzipping and installing the plugin, starting WIFI tether, starting PAW server.. and the piratebox plugin does not run. WiFi tether runs as usual.

Could the version of Wifi tether be the issue here?
[Android Software/Hacking General [Developers Only]] Wesleywarrior:
You need to install the plug-in once you have transferred it into the paw/html/plugins directory, it's outlined on the blog post but that didn't help me when I did it.

You need to start the PAW server first and then run the tether app so the normal paw server starts. Connect with your second device and you should be met with a log in screen.

Once you have logged in go to the plugins menu and click on the Piratebox plug-in and you can install it from there.
[Android Software/Hacking General [Developers Only]] Fusio9:
yes, of course, I am doing that.

It installs correctly (no warnings).

But then, it doesn't work.
[Android Software/Hacking General [Developers Only]] pengeren:
Not working on ZTE Blade, tested on stock rom and CyanogenMod7. :confused:
[Android Software/Hacking General [Developers Only]] FoulDroid:
Paw crash here with Tether enabled :(

Config in my sign.

edit: found ! coz' of server.xlm .. if i keep original file, no crash... :)
[Android Software/Hacking General [Developers Only]] arnohie:
Upload files types on Galaxy S Gingerbread

Hello,

I'm not sure to be at the good place to send this post.

A friend of mine have a Piratebox.

I can download everything from it but when I want to upload, My smartphone propose only three types of file (sound, vocal record and video). I can't access to any file manager and upload other files.

An idea ?

Sorry for my english.... I'm french !

Bests regards
[Android Software/Hacking General [Developers Only]] 77flem:
Hi,

i know it is not supposed to be used with CM but i tried with CM7 and CM9 on HP touchpad and can't get infrastructure mode working even tether app version used.

I get always failed msg on tether app log:

stopping driver failed

loading wifi firmware failed

starting driver failed

configuring softap failed

starting softap failed

activating wifi interface failed

if i use ad-hoc no problem but android devices can't connect to this mode that s why i prefer trying to use infrastructure.

Cheers.
[Android Software/Hacking General [Developers Only]] mattmenger:
I had to reduce the file size or PAW Server would FC before it ever even opened. I set it to 500MB, but I'm assuming you could make it bigger. The max file size with 24 "0"s was causing FCs on my Galaxy S i897

---------- Post added at 04:51 PM ---------- Previous post was at 04:47 PM ----------

I've tried everything, but my Windows PC (Win 7 64 bit) cannot connect to the network. Other Android devices can connect with no problem. I haven't tried a Mac yet. Any ideas on why that might be? Is the issue with Wifi Tether or PAW? I'm baffled. Any help would be appreciated!
[Android Software/Hacking General [Developers Only]] joschi70:
The maximum file size is an integer value (32bit), so it's limited to 2GB.

This is also the limit for most web browsers.
[Android Software/Hacking General [Developers Only]] mattmenger:
Ad-hoc network issue with Windows

For Windows 7, it appears that the ad-hoc networking feature, at least on my laptop is disabled. That defeats the purpose of Piratebox done this way - is there a better way to tether so that Windows will see it and it will work? Using the beta version of WiFi Tether I can create a good wifi network accessible by my laptop, but that brok the PAW server with piratebox.

I'm in over my head...
[Android Software/Hacking General [Developers Only]] nuFox:
Hi !

Thank's for the system ! i love the concept ! I have to make my box now ! :p

And it's work great on a HTC Desire !

Thank you !
[Android Software/Hacking General [Developers Only]] Wraithxt1:
Anyone know how to get this working with USB mass storage? I have an old tablet that reads my portable hard drive, I'd love to get this working with my 1 terrabyte portable drive.

Any ideas?
[Android Software/Hacking General [Developers Only]] joschi70:
Maybe this helps:

Changing the PirateBox Location
[Android Software/Hacking General [Developers Only]] Wraithxt1:
Well that's a real downer. I cant actually get WiFi tether for root users to work. The tablet is an old ZT-180. The application crashes when I start it up.

Is there any way I can use a different form of tethering?

EDIT: Nevermind, I guess I got too excited about this. I cant even get barnacle wifi tether working on my ZT-180. I really would have liked to use this with a portable drive. As it stands right now I dont think it's worth the trouble setting this up on an Android phone when I'll only have 16 gigs of storage to work with. Unless someone has a better idea, I'm just going to order a router. I have a Nexus One and a G1 I can work with.

EDIT2: The fact that getting USB host to work on the N1/G1 would require hours of effort is enough to turn me off to the idea. Would have been nice to repurpose my old devices, but it's not worth that much time.
[Android Software/Hacking General [Developers Only]] Wraithxt1:
So is this really abandoned? I cant get it working with the APK in the OP, and the OP hasnt been updated in months.

I'm guessing Piratebox for android is dead?
[Android Software/Hacking General [Developers Only]] Baganash:
No redirection to piratebox !

I try this how-to on a htc desire with supernova custom rom.

The piratebox is working (i can send and download) but :

-> there isnt redirection to piratebox.com. I need to give the IP address to the users to access the piratebox portal ! . This is annoying :/

-> And this is very slow !! Is it normal ?

Then i try the other method on fun2code but it doesnt work because the native tethering didnt working (no IP has been addressed to the connected device ...)

Anyone can help plz ?
[Android Software/Hacking General [Developers Only]] Wraithxt1:
As an update, its fully functional on my Nexus One save for redirecting the user to the site.

I can access the pirate box by inputting the IP.

Running a completey stock AOSP from rooted, and tried with CM 7. Neither work.
[Android Software/Hacking General [Developers Only]] Wraithxt1:
Been running since 27 March 2012 with no restarts, still works like a charm

http://fun2code-blog.blogspot.jp/2011/12/piratebox-on-android.html

Followed that exactly. Just bumping so more people can re-purpose their old Android phones like I did!
[Android Software/Hacking General [Developers Only]] Lokifish Marz:
Was just finishing up Piratebox optimized ROMs for the HeroS, Epic 4G and G2X and came across your thread. So I'm not the only one that does this.
[Android Software/Hacking General [Developers Only]] Wraithxt1:
Post a link! What did you do to the ROM to optimize it?
[Android Software/Hacking General [Developers Only]] pspunderground:
I have to say, Jochen has been keeping this well-updated. When I started this, we saw this on Gizmodo and it was just a small project to share music with my friends . Now, Jochen has made it perfect, and better than ever. Congrats!