Server :: Testing Scripts From Shell?
Jan 18, 2011How can I test a script that's written to receive arguments from an html form, from the shell?
View 6 RepliesHow can I test a script that's written to receive arguments from an html form, from the shell?
View 6 RepliesI'm writing a bash script that can be run by crontab or by a user interactively.
If the script is run by a user interactively, it will ask for a parameter interactively.
If the script is run by the crontab, it validates if a command line parameter is provided.
In doing so, I cannot get these tests to work inside the bash script
Code:
This shell is not interactive
How the tests be done inside a script?
I am learning exploit development and learning some stuff about shellcodes now! The shellcode is absolutely right and have tested it. I am using the following code...(created by me) to run my shellcode..
Code:
// #include<stdio.h> we will not be needing this as we are not using any functions from the C library...Just basic logic of Pointers..
char shellcode[] = "x31xc0xb0x01x31xdbxb3x07xcdx80"; // basic exit shellcode
int main()
{ int *ret; // a simple integer pointer pointing a address
ret = (int *)&ret + 2; // change the address pointed by
(*ret) = (int)shellcode; }
Compiling :-
Code:
aneesh@aneesh-laptop:~/articles/C$ gcc test.c -o test -fno-stack-protector
Compiling gives no errors as expected..
Now the problem I am facing is that As I run the program :-
Code:
aneesh@aneesh-laptop:~/articles/C$ ./test
Segmentation fault
Strace output :-
Code:
aneesh@aneesh-laptop:~/articles/C$ strace ./test
execve("./test", ["./test"], [/* 37 vars */]) = 0 .....
set_thread_area({entry_number:-1 -> 6, base_addr:0xb78016c0, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0
mprotect(0xf5e000, 8192, PROT_READ) = 0
mprotect(0x8049000, 4096, PROT_READ) = 0
mprotect(0x15c000, 4096, PROT_READ) = 0
munmap(0xb7802000, 81274) = 0
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++
Segmentation fault
I have some feeling that its because the program has no access to the memory containing the shellcode (May be???)..
I have comma separated file containing 3 fields:
Name,Shortcode,URL
Example of file is
Sony,52525,http://17.0.0.1/xyz
NDTV,53636,http://10.0.0.1/abc
Now i want to test every URL connectivity from my server by executing it using shell script and if url gives back response it shows output as "OK" in green color and if url is not responding it shows "NOT CONNECTED" in red color.
Output will be like following:
Sony 52525 OK
NDTV 53636 NOT CONNECTED
I am using ubuntu10.04-server 64bit AMD with fluxbox. After I ran Matlab in a shell (without GUI) the shell does not display characters anymore, but will execute any command, I just can't see the characters that I'm typing.. I use aterm and xterm, does anybody know why that is, am I missing a package?
View 1 Replies View Relatedhow can i teste that my slave dns work better;knowing that my primary dns is in an other machine .i tried to dig the slave ;i have the response but when i halt my primary dns ,i couldn't dig the slave dns.
View 6 Replies View RelatedIam using red hat linux for testing Apache server.The apache server "httpd" is working and in the web brower when i write "http://localhost" itshow me the apache test page. Well i want to know that where this test page exist and if i want to change this page and add my pwn web page then how can I do it. (My server IP address is 192.168.1.10 Subnet mask 255.255.255.0)
2- An other linux client computer is connection with a switch when it open its brower and write my apache server ip address in the web browser like http://192.168.1.10 it show melinux directory structure instead of apache test page. My client IP address is 192.168.1.20 Subnet mask 255.255.255.0)
3- My last computer running windows xp whic is(IP address 192.168.1.30 subnet mask 255.255.255.0 ) also connection with the switch for testing purpose.When I open IE and type http://1920.168.1.10 it say "page cannot be displayed"
This is what I have thus far:
1. uploaded Ubuntu 9.10 and finally got rid of windows
2. installed LAMP -
3. trying to extract a site to var/www
The Problem: I keep getting the message I do not have permission to that folder.
I would like some opinions on creating a two computer network so I can study a server in action. I would prefer that it was on a level below accessing the internet and then being routed back at this point. Installing a router is fine.
View 1 Replies View RelatedHow do i test negotiation between server and client for various protocols like:
ppp
pppoe
pptp
L2tp
dhcp
I would like to have a script which I can use to test if files on some certain sites are available and if their size is bigger then 0 bytes. I do not want to download them, only check them. If I would use wget they get downloaded I think.
View 1 Replies View RelatedI am interested in setting up a webserver on a PC I have laying around...more for the experience and knowledge of learning it from scratch. I have used dedicated servers before with webhosting, but did not do the installations of apache and other items. The server we had purchased had CentOS installed.
My question is, can I use this desktop I have to simply install the CentOS DVD torrent off their website, and start from there, with installing apache, and all the other items associated with a server environment to test/play around, or is there a difference and something I am missing with my plan to do this?
The end result will be having my desktop setup as a "server" I can ssh into and screw around with just to learn more about it.Sorry for the basic question. (i posted this here instead of the "newbie" section, since i figured it would get moved here)
how can i update php to the latest version from the testing repo via USB ? my machine has no internet access and no cdrom, my only choice is via USB, i have a 2 gb USB.
edit: i am trying to follow this guide: [URL] since i have no internet access, i have downloaded all files to my USB stick. i added the testing repo manually. is there a way to instruct centos to update these packages from my usb stick ? since i have them on USB, i can upload them on centos.
I had installed Ubuntu 10 to my desktop computer & I want to make it as DHCP server with Router, and use it for testing. I had installed dhcp server (apt-get install dhcp3-server) what should I do further? What file to edit?Also , I had 2 network cards, so I had to assign correctly the IPs & interfaces.
View 1 Replies View RelatedUsing the following software:
Ubuntu Server 8.04
SquirrelMail 1.4.13
Postfix 2.5.1
Courier 0.59.0 (Courier-IMAP 4.3.1)
Apache2 2.2.8
I've installed a mail server per the instructions at [url].
Neither POP nor IMAP test successfully with the user that I just added after following the setup instructions.
This doesn't make any sense. I added the user to the mysql database:
Code:
And after I did that, I ran the postfix reload command. If I try to log in as firstuser@mydomain.com, which is the user I created during the setup and configuration process, it works fine.
I checked the virtual mail account's home folder, and under the mydomain.com folder, I only see a folder for firstuser. I'd create one for testuser manually, but I don't know if that'll work since it seems to contain a particular folder structure of its own.
Is there some other command that I have to run? I don't recall having to do anything additional when setting up firstuser.
is any apache-module out there that allows duplicating traffic?
I want to test an new Application Server by duplicating the traffic from the old production system. Answers of the new will be DROPped ...
I need address of ftp server that has the latest .iso of Debian testing (weekly build).unfortunately, cdimage.debian.org/cdimage/weekly-builds/ is useless to me as it does NOT support ACTIVE FTP.
View 3 Replies View RelatedI am trying to set up to serve Linux kernels and filesystems disklessly, and find the startup and test procedure a bit tedious.Can anyone point to a tool or tools to allow me to see what is going on with my DHCP/TFTP/PXE setup, which I'm trying to get working? Ideally, I'd like a tool that can do something like grab an IP from a DHCP/BOOTP server, tell me all about all that it found, and then if it was told to download a file, it could do that and tell me about how that went, and so on. Between the information reported by the tool and the droppings left in logfiles on the server side, I would hope to simplify the configuration process, as well as let me experiment with various options, etc. Even a PXE client tool that I can use to exercise my tftp PXE server configuration from a shell commandline would be extremely useful.If no such tool already exists, would anyone else find something like this useful?
View 3 Replies View Relatedhow to setup a local mail server for internal testing on my php development work. For example if I sent an email using php script to [url]....I should be able to check the mailbox of 'someone' either in Outlook or SquirrelMail.I have done some reading about this. All I know is that I need Postfix with Courier. But I just don't know to get it working.
View 3 Replies View RelatedQuote:
/usr/local/bin/mencoder /root/video1.avi -of lavf -ovc lavc -lavcopts vcodec=flv:vbitrate=300:acodec=libfaac:abitrate=64 -srate 22050 -oac lavc -vf scale=360:240 -o /root/output_temp_video1.flv
[code]....
I have to have a Linux server for shell programming on Windows (XP) clients
View 3 Replies View RelatedIs there a way to run CentOS 5.2 update system using the shell, avoiding the GUI (I want to do it remotely using SSH?
View 1 Replies View RelatedI am using Fedora 13 and I have one program (wine) that I need to start grabbing for the updates-testing repo instead of the default repositories in order to get newer versions. I think I can figure out how to add that repository, but I need to know if there are any others I need to disable or any other changes I need to make to my system so that I don't confuse my set up with conflicting updates.
Also, is there anything special I need to do to be sure that only that one program is grabbed from the testing repo when I run regular updates?
How do i configure the system and user accounts so that the users can't access each others directories, delete system files, install packages etc.I know i am probably going to need tools like chmod mkdir useradd.But i can't figure out how.If you know a good tutorial, please point me in that direction.
View 3 Replies View RelatedI have installed a puppet server and its client on Centos.Puppet server and its client is running fine and its update whatever changes made on Puppet server is updatedon its client but i am unable to execute script (Bash shell)on the client through Puppet server. So please advice a suitable class or parameter for Puppet server so that it could execute on its client
View 3 Replies View RelatedI'm new to linux and try to make a ubuntu home server.1.One of my concerns is that i can't figure out how to use bittorrent (or any other torrent download application) from shell. (i have the desktop package installed but i don't wanne get used with that - or should i start the downloads from there but if I close the gdm (gdm stop) will my bittorrent stop as well?)
View 9 Replies View RelatedI need a to allow a user to tunnel an ssh session but disallow them a bash shell. # chsh -s /sbin/nologin {username} won't cut it...? would permissions be the way to go with it? But how? Setup a group and add the user to that group? Or add all other users to that group... I'm confused
View 3 Replies View RelatedI have 2 servers, let say server1 and server2. I have create ssh-keygen from server1 to server2, I can ssh from server1 to server2 without typing a password. My question is: How can I use command from server1 to server2? for example I want to list file in server2 /home directory from server1.
View 1 Replies View RelatedWe've converted several older unix servers from HP UX to VM's running RHEL 5.The database applications and everything else run great, however we have a group of programmers who need to be able to use character based, wyse60 sessions using tiny term. I'm having trouble making the cool elements in bash work in this emulator, and even more trouble simply replicating what was available in the /sbin/sh used in HP UX?
View 1 Replies View Relatedwhy apache2 won't run my shell script i made.So in detail this is what i want it to do. I have a apache2 web-server running on my mac and i found some shell commands that control itunes so i wrote a shell script that basically pause's itunes. Now i have put the shell script in the cgi executable folder. and the link for the webpage is http://10.10.0.110/cgi-bin/itunes.sh but when i goto the page in my browser it just keeps loading. I have run other scripts and they work and i don't think you need root access.
View 7 Replies View Related