{Fonero} Seeking compiled WGET with POST functionality

Post new topic   Reply to topic    DD-WRT Forum Index -> Atheros WiSOC based Hardware
Author Message
ifyhcrdi.i1h
DD-WRT Novice


Joined: 06 Jul 2020
Posts: 14

PostPosted: Fri Jun 25, 2021 14:09    Post subject: {Fonero} Seeking compiled WGET with POST functionality Reply with quote
TL;DR: Using DD-WRT v2019/08/06 on my Fonero router - the builtin 'wget' doesn't do http POST submissions - where can I get a better wget (or busybox), or what can I use instead of wget to effect 'POST' goodness?

=-=-=-=-

I'm using my FON ('Fonero') router as a repeater with v2019/08/06 (r40559). (FWIW: The newest versions of DD-RT are FWfail because the WiFi radio never comes up, alive.)

I want my FON to automatically navigate the captive portal login of an upstream, open-WiFi AP. I have successfully done this on my desktop, using wget.

I tried using the wget which is builtin to the router (via busybox), however it's not compiled with http POST support (by way of the '--post-data' parameter - equating to a urlencoded form submission)... so no joy.

I did try snarfing about the net for anything precompiled that someone had made available but none of the dozen or so promising candidates would fly, I believe due to the uncommon? cpu config - "MIPS32" (so it seems that plain ole MIPS is insufficient?!).

In case it's helpful - this is what 'file' tells me about the existing busybox executable that works fine:

Code:

busybox_v1.31.0:    ELF 32-bit MSB executable,
                              MIPS,
       the fussy?-->   MIPS32 version 1,
                              dynamically linked,
                              interpreter /lib/ld-musl-mips-sf.so.1,
                              corrupted section header size


So might anyone have any ideas about how to acquire either a standalone wget, or a busybox that includes a more featureful wget (that doesn't involve the massive effort of me setting up an x-compile enviro)?

If seeking this alternative wget (or busybox) looks UNpromising please do note that I don't mind at all skinning the cat another way if you have an idea of how to solve this alternatively - i.e. not using wget but satisfying the upstream router's need for the POST submission differently; I tried a quick barf of bytes via 'nc' but that didn't payoff... maybe due to an imperfect bytestream?

Cheers & thx!
Sponsor
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14125
Location: Texas, USA

PostPosted: Fri Jun 25, 2021 14:23    Post subject: Reply with quote
If you're referring to the wifi led not coming on, that doesn't mean the wireless is bad:

https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=325092

Did you try a more recent build from *this* year?

https://download1.dd-wrt.com/dd-wrtv2/downloads/betas/2021/

Also, if you would have done some web searching, you would realize that wget does NOT support POST functionality. However, curl does; but curl is not included in the firmware images for the Fonera, if I'm not mistaken.

We have no idea what the larger picture problem here is, either. Perhaps that is where we should focus after you've updated your firmware or not.

_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
ifyhcrdi.i1h
DD-WRT Novice


Joined: 06 Jul 2020
Posts: 14

PostPosted: Fri Jun 25, 2021 16:16    Post subject: Reply with quote
kernel-panic69 wrote:
If you're referring to the wifi led not coming on, that doesn't mean the wireless is bad:
Nope, I mean the AP named 'dd-wrt' never appears in my WiFi list.

My flash method is:
- always via wired
- affirm the option to reset to defaults
- just wait, and look for AP named 'dd-wrt' to appear, to signal completion

Of note, I never dual-reboot, pull power or anything - just plain & simple (e.g. as it worked for 40559, 43443, 43471, 45229)

Quote:
Did you try a more recent build from *this* year?
Yep, I tried all of these, and all were radio FAIL for me:
r45767 21/02/17
r46239
r46836
r46958 21/06/18

TBH tho, 45229 (21/01/01) did have radio working but since WiFiLED was permaoff I thought I'd just avoid.

Anyway, I'll try shortly to move to something more current.

Quote:
Also, if you would have done some web searching, you would realize that wget does NOT support POST functionality.
Meh, ur mistaken - I don't need post-a-file, I need urlembedded POST, which:
a) wget *does* support POST, per parm '-h' in v1.19.4 (i.e. using '--post-data')
b) I already proved that wget is success, via testing on my desktop!!!

Quote:
However, curl does; but curl is not included in the firmware images for the Fonera, if I'm not mistaken.
No curl in my current r40559 setup.

I'll slog onto a newer FW version...
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14125
Location: Texas, USA

PostPosted: Fri Jun 25, 2021 18:33    Post subject: Reply with quote
You're soft-bricking your Fonera; Also, you probably shouldn't be flashing these via webupgrade, that I know of. But if you are able to, do not select "reset to defaults" when upgrading as it will require a power cycle due to the soft brick.

I will concede, perhaps that link I posted is erroneous, but busybox wget is not wget-proper; it is a busybox'd version - but it does support post-data if wget_long_options is compiled in (which it is not for Fonera).

https://git.busybox.net/busybox/tree/networking/wget.c?h=1_33_stable

https://svn.dd-wrt.com/browser/src/router/rules/busybox.mk

https://svn.dd-wrt.com/browser/src/router/busybox/.config_fonera

On a device with such little flash, there is likely no curl included, no matter which firmware version you flash.

_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
ifyhcrdi.i1h
DD-WRT Novice


Joined: 06 Jul 2020
Posts: 14

PostPosted: Fri Jun 25, 2021 19:48    Post subject: Reply with quote
kernel-panic69 wrote:
You're soft-bricking your Fonera;
If true, what's the significance of that?

(To be clear, I'm just doing the typical dumb-user webpage upgrade... nothing fancy.)

Quote:
Also, you probably shouldn't be flashing these via webupgrade, that I know of.
Why not? It works, time and time again.

Quote:
But if you are able to, do not select "reset to defaults" when upgrading as it will require a power cycle due to the soft brick.
Well, I've been using that method (via webpage, and AFFIRM reset-to_defaults) time and time again and it works reliably and predictably.

(In the past week I've applied about 12 or 15 FW's; once I had to use redboot cuz something FUBAR'd previously but elsewise all were by WebUI.)

Quote:
<snip>

On a device with such little flash, there is likely no curl included, no matter which firmware version you flash.
Colour me crazy there kernel, but I feel like you're now caught up to me : )

And with that ... back to my original question: what alternative methods or executables are available to me?

For instance, can I use Optware on my FON? If so can I install a wget IPKG (or curl IPKG)?

Can I retrieve one of these IPKG files and just extract the wget or curl from within in?

Thx for any info or leads!
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14125
Location: Texas, USA

PostPosted: Fri Jun 25, 2021 20:02    Post subject: Reply with quote
These devices don't have a USB port, do they? I am fairly certain they do not. Entware / optware is not an option. Maybe you should consider telling us what you're trying to do with wget (and why you're trying to do it with such an old device as a Fonera). Keep in mind, depending on what the goal is here, it will determine whether or not the discussion continues.
_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
ifyhcrdi.i1h
DD-WRT Novice


Joined: 06 Jul 2020
Posts: 14

PostPosted: Fri Jun 25, 2021 20:24    Post subject: Reply with quote
kernel-panic69 wrote:
These devices don't have a USB port, do they? I am fairly certain they do not.
Correct, they have NO USB port.

Quote:
Entware / optware is not an option.
I thought that the FON having JFFS2 available might be my saviour?

Quote:
Maybe you should consider telling us what you're trying to do with wget
I did, and I did (or so I thought?!)

Please see, in my OP, the first 2 paragraphs after the small TL;DR blurb?! If that leaves you with further q's please elaborate.

Quote:
(and why you're trying to do it with such an old device as a Fonera).
Well, reason #1 is cuz I have a few of them, sitting unused. (Would you prefer I use my WRT54GS v1.1? : )

Quote:
Keep in mind, depending on what the goal is here, it will determine whether or not the discussion continues.
I don't quite understand the meaning of what you're saying here - can you elaborate?

Thx again!
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14125
Location: Texas, USA

PostPosted: Fri Jun 25, 2021 23:39    Post subject: Reply with quote
It sounds as if you want the FON to automatically login to an open, but secured wireless AP. Is it one that you have valid credentials to and are allowed to connect to?
_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
ifyhcrdi.i1h
DD-WRT Novice


Joined: 06 Jul 2020
Posts: 14

PostPosted: Sat Jun 26, 2021 0:13    Post subject: Reply with quote
kernel-panic69 wrote:
It sounds as if you want the FON to automatically login to an open, but secured wireless AP. Is it one that you have valid credentials to and are allowed to connect to?
Oh, I now see what you're concerned about.

To be clear about my situation... the upstream AP is:
- using no encryption for its signal, and
- does not require *any* credentials

It is both radio-open, and usable-by-anyone-open. One only needs to click the submit button (or effect equivalent action) to acknowledge accepting the usage terms. It's been put in place specifically for use by the public.

So all in, my answer to your question is:
yes

Smile
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14125
Location: Texas, USA

PostPosted: Sat Jun 26, 2021 0:41    Post subject: Reply with quote
All I can say is good luck (lookee here, more reading!):

https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=304147

_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
ifyhcrdi.i1h
DD-WRT Novice


Joined: 06 Jul 2020
Posts: 14

PostPosted: Sat Jun 26, 2021 21:13    Post subject: Reply with quote
kernel-panic69 wrote:
All I can say is good luck (lookee here, more reading!):
https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=304147
Meh, the folks in that thread are pikers - nobody was doing anything bespoke, or even lifting the hood to looksee about what wasn't working.

In my case I'm not looking to build a:
- 'universal/generic' open-AP connector
I'm looking to build one to connect to a *specific* AP.

(TBH, my holy grail is to have the FON auto-connect to the AP, update its clock via ntp, open up an OpenVPN TAP to my server and then any device which connects to the FON AP side will be connecting to my VPN and getting a DHCP addy from it). We'll see...
ifyhcrdi.i1h
DD-WRT Novice


Joined: 06 Jul 2020
Posts: 14

PostPosted: Tue Jun 29, 2021 1:34    Post subject: Reply with quote
My attempt at using 'nc' as a workaround to being unable to do a http POST shows promise! So just an FYI for any readers in the same boat as I.

Of note - this sort of hack won't work for HTTPS connections (can only work for HTTP).

This is what was successful for me (and where the double '%' marks tell you this is DOS/Windows batch code)...
Code:

            (
                printf "%%s\r\n" "POST /login.html HTTP/1.1"
                printf "%%s\r\n" "Accept: text/html, application/xhtml+xml, */*"
                printf "%%s\r\n" "Referer: http://10.99.99.99/login.html?redirect=www.google.com/"
                printf "%%s\r\n" "Accept-Language: en-CA"
                printf "%%s\r\n" "Content-Type: application/x-www-form-urlencoded"
                printf "%%s\r\n" "User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko"
                printf "%%s\r\n" "Accept-Encoding: gzip, deflate"
                printf "%%s\r\n" "Host: 10.99.99.99"
                printf "%%s\r\n" "Content-Length: 128"
                printf "%%s\r\n" "DNT: 1"
                printf "%%s\r\n" "Connection: Keep-Alive"
                printf "%%s\r\n" "Cache-Control: no-cache"
                printf "\r\n"

                    printf "%%s" "buttonClicked=4&"
                    printf "%%s" "err_flag=0&"
                    printf "%%s" "err_msg=&"
                    printf "%%s" "info_flag=0&"
                    printf "%%s" "info_msg=&"
                    printf "%%s" "redirect_url=http*3A*2F*2Fwww.google.com*2F&" | tr "\052" "\045"
                    printf "%%s" "network_name=Guest+Network"
           ) | grep.exe -v "NO_MATCH" | tr -s "\r" | nc   -n    -p 12345   -s 172.16.150.111     10.99.99.99    80   
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Atheros WiSOC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum