[SOLVED] Searching source codes

Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions
Goto page Previous  1, 2, 3
Author Message
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12836
Location: Netherlands

PostPosted: Sat Aug 27, 2022 17:07    Post subject: Reply with quote
Yes ASP is a file extension meant for HTML/Javascript so that is what is displaying in your webbrowser and is used to get information from and to the user via a webbrowser

CGI (Common Gateway Interface) is used for the communication between webrowser and router (not my field of expertise)

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
Sponsor
kernel-panic69
DD-WRT Guru


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

PostPosted: Sat Aug 27, 2022 17:18    Post subject: Reply with quote
mwchang wrote:
the-joker wrote:
The Interface is split between css, javascript, bash scripts, cgi, asp, C, htm, and webconfig files all over the source, its not like there is a single folder with all of it, so that alone to come close to mastering is a 24/7 job 365 days a year for 5 years.

"A single folder with all of it" was possible, if and only if the WEBUI used PHP instead of C? But then DD-WRT is an old project. Way way back then not even CSS was standard and available. That explained the heavy use of Javacript and CGI.

"ASP"? Isn't it just a file extension? Was it really Active Server Page of Micro$oft?

BTW, I think DD-WRT wrote its own C-based web server for the WBEUI? I wasn't sure...

DD-WRT/httpd.c at master · jameshilliard/DD-WRT · GitHub
https://github.com/jameshilliard/DD-WRT/blob/master/src/router/httpd/httpd.c

Waiting for the explosion and implosion mentioning PHP, lol. The httpd is the one from original Linksys GPL/Sveasoft AFAIK. It has just been added to and modified during the course of DD-WRT development. While the source code tree is a behemoth and a daunting task, it doesn't take that long to "master", but sometimes it's easy to get lost...

_________________
"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
mwchang
DD-WRT Guru


Joined: 26 Mar 2013
Posts: 1855
Location: Hung Hom, Hong Kong

PostPosted: Sat Aug 27, 2022 18:10    Post subject: Reply with quote
egc wrote:
Yes ASP is a file extension meant for HTML/Javascript so that is what is displaying in your webbrowser and is used to get information from and to the user via a webbrowser

I think the extension was merely used to fool Internet Explorer back then. I don't think DD-WRT's custom web server could serve real Active Server Pages! Smile


_________________
Router: Asus RT-N18U (rev. A1)

Drink, Blink, Stretch! Live long and prosper! May the Force and farces be with you!

Facebook: https://www.facebook.com/changmanwai
Website: https://sites.google.com/site/changmw
SETI@Home profile: http://setiathome.berkeley.edu/view_profile.php?userid=211832
GitHub: https://github.com/changmw/changmw
mwchang
DD-WRT Guru


Joined: 26 Mar 2013
Posts: 1855
Location: Hung Hom, Hong Kong

PostPosted: Sat Aug 27, 2022 18:13    Post subject: Reply with quote
kernel-panic69 wrote:

Waiting for the explosion and implosion mentioning PHP, lol. The httpd is the one from original Linksys GPL/Sveasoft AFAIK. It has just been added to and modified during the course of DD-WRT development. While the source code tree is a behemoth and a daunting task, it doesn't take that long to "master", but sometimes it's easy to get lost...

I don't think I need to read the codes of the C web server, but the places that do CGI to manage NVRAM values and calling daemons.

PHP's memory and storage requirements might be too big for old routers with limited flash RAM and slow router processors. Also, back then PHP wasn't that mature. So it's ruled out? Was Perl ever considered? Well...

_________________
Router: Asus RT-N18U (rev. A1)

Drink, Blink, Stretch! Live long and prosper! May the Force and farces be with you!

Facebook: https://www.facebook.com/changmanwai
Website: https://sites.google.com/site/changmw
SETI@Home profile: http://setiathome.berkeley.edu/view_profile.php?userid=211832
GitHub: https://github.com/changmw/changmw
the-joker
DD-WRT Developer/Maintainer


Joined: 31 Jul 2021
Posts: 2146
Location: All over YOUR webs

PostPosted: Sat Aug 27, 2022 19:34    Post subject: Reply with quote
PHP has no place here IMO (mind I have some strong opinions about PHP), its a POS security wise.

As for file paths things than belong to one part belong together in theory) maybe it would be easier to find them all under one place for the web interface or whatever, but its not always possible and dealer decides at implementation time.

there have been recently squashed 16, 15, 12 year old issues where pages and related strings (text you see in UI) had not been touched and were not even translatable (hardcoded) not that anyone notice and this says something about our translation system.

So it wont be difficult to find stuff to improve, I could save you some time and tell you translations needs plenty love. Not only in actually translating the base english.js to other languages other than German but developing a frontend for users to submit those translations without knowing SVN/Git.

I cant wait to see what you suggest that really makes an impact and is in the end accepted and implemented, its always welcome to see different points of view so I welcome anything that really may cause real change and improvement but also better ideas to come forth as a product of such.

You dont need anyone approval, so go forth and makes us dream golden.

_________________
Saving your retinas from the burn!🔥
DD-WRT Inspired themes for routers
DD-WRT Inspired themes for the phpBB Forum
DD-WRT Inspired themes for the SVN Trac & FTP site
Join in for a chat @ #style_it_themes_public:matrix.org or #style_it_themes:discord

DD-WRT UI Themes Bug Reporting and Discussion thread

Router: ANus RT-AC68U E1 (recognized as C1)
kernel-panic69
DD-WRT Guru


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

PostPosted: Sun Aug 28, 2022 0:49    Post subject: Reply with quote
Well, to be honest, PHP is for databases. There is no database (nvram variables are not a database, nor are csv) in DD-WRT. When it comes down to it, all router firmware uses ASP/HTML/Javascript/CGI in conjunction with C of some sort.

Everything past 49909 is "interesting to see" regarding the webUI. Not spending a whole lot of time today "stepping through the minefield" on 49934M on RT-AC68U E1, just letting it abide until Monday. I don't know of any firmware development tree that has all of the webUI bits in a single location. I also don't know of any firmware that has such a "complicated" webUI code tree, either. Not a complaint, nothing negative, just an observation.

_________________
"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
mwchang
DD-WRT Guru


Joined: 26 Mar 2013
Posts: 1855
Location: Hung Hom, Hong Kong

PostPosted: Sun Aug 28, 2022 12:28    Post subject: Reply with quote
kernel-panic69 wrote:
Well, to be honest, PHP is for databases. There is no database (nvram variables are not a database, nor are csv) in DD-WRT. When it comes down to it, all router firmware uses ASP/HTML/Javascript/CGI in conjunction with C of some sort.

You don't have to couple PHP with a database. PHP can execute shell commands as well. It's entirely possible to build a new WEBUI with PHP and Lighttpd, possibly with much simplicity and less reliance on Javascript. PHP can also interact with C.

Anyway, DD-WRT cannot abandon old routers. Smile

_________________
Router: Asus RT-N18U (rev. A1)

Drink, Blink, Stretch! Live long and prosper! May the Force and farces be with you!

Facebook: https://www.facebook.com/changmanwai
Website: https://sites.google.com/site/changmw
SETI@Home profile: http://setiathome.berkeley.edu/view_profile.php?userid=211832
GitHub: https://github.com/changmw/changmw
mwchang
DD-WRT Guru


Joined: 26 Mar 2013
Posts: 1855
Location: Hung Hom, Hong Kong

PostPosted: Tue Oct 25, 2022 9:25    Post subject: Reply with quote
kernel-panic69 wrote:
The pathname issue seems to no longer exist in both Win10 and newer WSL:

https://www.reddit.com/r/bashonubuntuonwindows/comments/lavqhi/is_anyone_else_using_wsl_to_circumvent_windowss/

I've dabbled in using WSL to test compiling of other things, but not DD-WRT more recently, but I would advise to keep everything Linux, if possible. Less chance of error until WSL has been fully bug-proofed.

As a first step, I am using DD-WRT with a USB drive to search and read the codes. Both WSL2 and WSL in Window$ 10/11 are indeed quite interesting. It's not a VM, but running Linux natively with Window$.

_________________
Router: Asus RT-N18U (rev. A1)

Drink, Blink, Stretch! Live long and prosper! May the Force and farces be with you!

Facebook: https://www.facebook.com/changmanwai
Website: https://sites.google.com/site/changmw
SETI@Home profile: http://setiathome.berkeley.edu/view_profile.php?userid=211832
GitHub: https://github.com/changmw/changmw
the-joker
DD-WRT Developer/Maintainer


Joined: 31 Jul 2021
Posts: 2146
Location: All over YOUR webs

PostPosted: Tue Oct 25, 2022 11:54    Post subject: Reply with quote
WSL/WSL2 is a nice way to get malware bypassing any windows based antivirus, hence I dont use it. And it also bypasses the Firewall.

https://blog.lumen.com/no-longer-just-theory-black-lotus-labs-uncovers-linux-executables-deployed-as-stealth-windows-loaders/

https://www.bleepingcomputer.com/news/microsoft/windows-subsystem-for-linux-2-bypasses-the-windows-10-firewall/

OK those are old news and there are others for WSL2 in any case I dont trust it, even if they patched it up this is by far an unnecessary attack surface to expose and take a chance on

https://blog.f-secure.com/wsl2-the-other-other-attack-surface/

_________________
Saving your retinas from the burn!🔥
DD-WRT Inspired themes for routers
DD-WRT Inspired themes for the phpBB Forum
DD-WRT Inspired themes for the SVN Trac & FTP site
Join in for a chat @ #style_it_themes_public:matrix.org or #style_it_themes:discord

DD-WRT UI Themes Bug Reporting and Discussion thread

Router: ANus RT-AC68U E1 (recognized as C1)
mwchang
DD-WRT Guru


Joined: 26 Mar 2013
Posts: 1855
Location: Hung Hom, Hong Kong

PostPosted: Tue Oct 25, 2022 12:44    Post subject: Reply with quote
the-joker wrote:
....

https://www.bleepingcomputer.com/news/microsoft/windows-subsystem-for-linux-2-bypasses-the-windows-10-firewall/

OK those are old news and there are others for WSL2 in any case I dont trust it, even if they patched it up this is by far an unnecessary attack surface to expose and take a chance on

https://blog.f-secure.com/wsl2-the-other-other-attack-surface/

Thanks! A bit surprised by that firewall bypass thing. But most Linux distributions come with built-in firewall service(iptables), so it might not be a big problem.

Does Hyper-V bypass the firewall of its host Window$? It seems that it does not.

_________________
Router: Asus RT-N18U (rev. A1)

Drink, Blink, Stretch! Live long and prosper! May the Force and farces be with you!

Facebook: https://www.facebook.com/changmanwai
Website: https://sites.google.com/site/changmw
SETI@Home profile: http://setiathome.berkeley.edu/view_profile.php?userid=211832
GitHub: https://github.com/changmw/changmw
the-joker
DD-WRT Developer/Maintainer


Joined: 31 Jul 2021
Posts: 2146
Location: All over YOUR webs

PostPosted: Tue Oct 25, 2022 13:24    Post subject: Reply with quote
Wouldn't know, I dont use hyper-v, my first exposure to virtualization was vmware for configuring cisco routers and switches at enterprise level, though for my personal usage I prefer virtualbox. I inherently distrust most Microsoft solutions for most anything I do day to day and because my Windows install doesnt have asimov and other crap.

But WSL/2 you dont get to use the whatever distro firewall so meh, anyway thanks but no thanks. Microsoft can keep their half baked solutions and attack surfaces large enough to fit the moon, bad enough I am forced to use Windows.

_________________
Saving your retinas from the burn!🔥
DD-WRT Inspired themes for routers
DD-WRT Inspired themes for the phpBB Forum
DD-WRT Inspired themes for the SVN Trac & FTP site
Join in for a chat @ #style_it_themes_public:matrix.org or #style_it_themes:discord

DD-WRT UI Themes Bug Reporting and Discussion thread

Router: ANus RT-AC68U E1 (recognized as C1)
mwchang
DD-WRT Guru


Joined: 26 Mar 2013
Posts: 1855
Location: Hung Hom, Hong Kong

PostPosted: Tue Oct 25, 2022 15:38    Post subject: Reply with quote
the-joker wrote:
But WSL/2 you dont get to use the whatever distro firewall so meh, anyway thanks but no thanks. Microsoft can keep their half baked solutions and attack surfaces large enough to fit the moon, bad enough I am forced to use Windows.

When using a VM, guest Linux will be booted. But in a WSL "shell", I dunno whether the Linux inside will go through the boot process... anyone tried it (and save everyone some testing time)??

That's exactly why the WSL firewall bypass surprised me... is it a booby trap deliberately set by Micro$oft? Just like Window$ Update .... But why should Micro$oft care about Linux!? Smile

_________________
Router: Asus RT-N18U (rev. A1)

Drink, Blink, Stretch! Live long and prosper! May the Force and farces be with you!

Facebook: https://www.facebook.com/changmanwai
Website: https://sites.google.com/site/changmw
SETI@Home profile: http://setiathome.berkeley.edu/view_profile.php?userid=211832
GitHub: https://github.com/changmw/changmw
Goto page Previous  1, 2, 3 Display posts from previous:    Page 3 of 3
Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions 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 can attach files in this forum
You can download files in this forum