Jump to content


Photo
- - - - -

MSDOS Commands


  • Please log in to reply
12 replies to this topic

#1 cigraphics

cigraphics

    Young Padawan

  • Members
  • Pip
  • 92 posts
  • Gender:Male
  • Location:London

Posted 01 June 2006 - 09:45 AM

This script is for msdos commands i've made it for my webserver
<html>
<head>
<title>Command</title>
<style type="text/css">
.area {
width:100%;
height:90%;
}
</style>
</head>
<body>
<textarea class="area" readonly="readonly">
<?php
if($sys == NULL){} else {
$cmd = system($sys);
echo $cmd;
}
?>
</textarea>
<form method="post">
<input type="text" name="sys" />
<input type="submit" value="Command" />
</form>
</body>
</html>
you can try commands like ping, arp, del, mkdir, ....etc

#2 Indigo

Indigo

    Official Alien

  • Members
  • PipPipPip
  • 617 posts
  • Gender:Male
  • Location:Trondheim, Norway
  • Interests:Computing in general, especially design and programming of all kinds.

Posted 01 June 2006 - 02:21 PM

This is more like a script than a tutorial, ain't it?
So if I insert in the form "shutdown -s" it'll do that to my computer? Or my server?
Anyway, thanks for sharing.

#3 Matthew.

Matthew.

    Official Spammer .Matt

  • Members
  • PipPipPipPip
  • 2,749 posts
  • Gender:Male
  • Location:England

Posted 02 June 2006 - 05:52 PM

This is a tad silly, unless your host is completly brainless, you will be very limited to what you can do with system().

indigo, it wouldnt do either ^_^

shutdown wouldnt work on the server.

#4 cigraphics

cigraphics

    Young Padawan

  • Members
  • Pip
  • 92 posts
  • Gender:Male
  • Location:London

Posted 16 June 2006 - 11:07 AM

it will work on a windows server ^_^ with apache not with iis or you can try other commands on linux line w, uname -a, or in windows ping, arp, ..etc

#5 coldkill

coldkill

    Young Padawan

  • Members
  • Pip
  • 11 posts
  • Gender:Male
  • Location:Devon, United Kingdom

Posted 19 June 2006 - 05:49 PM

Instead of making the parser work harder with
if( $sys == NULL )
{

}
else 
{
		  $cmd = system($sys);
		  echo $cmd;
}

you can use
if( $sys != NULL )
{
		 $cmd = system($sys);
		  echo $cmd;
}
which is alot simpler, clearer and it saves resources if even only a fraction.

Also i doubt, unless you have a Dedicated or Virutal Private Server your username will have access to shut the server down. Imagine the amount of support tickets when, potentially, hundreds of users sites go down? Your host wouldn't be happy.

#6 Matthew.

Matthew.

    Official Spammer .Matt

  • Members
  • PipPipPipPip
  • 2,749 posts
  • Gender:Male
  • Location:England

Posted 20 June 2006 - 07:56 AM

edit:n/m

Edited by matthewJ, 21 December 2006 - 12:37 PM.


#7 makavelimx

makavelimx

    Young Padawan

  • Members
  • Pip
  • 69 posts
  • Interests:Events Manager of MD5Encryption.com

Posted 21 June 2006 - 12:14 AM

it will work on a windows server :P with apache not with iis or you can try other commands on linux line w, uname -a, or in windows ping, arp, ..etc


Wrong, shutdown -s will NOT work on Apache on windows, it also doesn'tw ork on IIS

ping, ipconfig, etc works but obviously not shutdown, its too big of a security risk

Oh yea, shells like wget won't work either

O yea, fyi, I tried all the stuff I claimed :)

#8 Hit3k

Hit3k

    Young Padawan

  • Members
  • Pip
  • 120 posts
  • Gender:Male
  • Location:Australia

Posted 13 July 2006 - 06:00 AM

If its a dedicated server you can do some pretty malicious shit..(Excuse the language) but this script also has a bit of a security risk...
FOR EXAMPLE
$cmd = cat /etc/passwd;
$sys = system($cmd);
echo $sys;
I've tried it on my server.. I should try it on my host.. but I'm sure someone can correct me if I'm wrong :biggrin: btw I'm running Linux..

Edited by Hit3k, 13 July 2006 - 06:05 AM.


#9 cigraphics

cigraphics

    Young Padawan

  • Members
  • Pip
  • 92 posts
  • Gender:Male
  • Location:London

Posted 15 December 2006 - 06:20 AM

Wrong, shutdown -s will NOT work on Apache on windows, it also doesn'tw ork on IIS

ping, ipconfig, etc works but obviously not shutdown, its too big of a security risk

Oh yea, shells like wget won't work either

O yea, fyi, I tried all the stuff I claimed smile.gif

I tried it with apache2triad and shutdown -s -t 0 works fine and all other msdos commands with Windows XP Service Pack 2

#10 Archbob

Archbob

    Young Padawan

  • Members
  • Pip
  • 12 posts

Posted 15 December 2006 - 10:55 AM

I've tried running stringed Unix commands with system and exec, trust me, its a nightmare.

#11 Jynxis

Jynxis

    Young Padawan

  • Members
  • Pip
  • 132 posts
  • Location:The Shadows

Posted 21 December 2006 - 04:29 AM

lol, in the wrong hands, this information is dangerous.

Edited by PlaGuEX, 21 December 2006 - 04:44 AM.


#12 _*Ultimate`_*

_*Ultimate`_*
  • Guests

Posted 09 January 2008 - 02:09 AM

Haha! that's pretty awesome I think!

#13 Mr. Matt

Mr. Matt

    Moderator

  • Validating
  • PipPipPipPip
  • 1,945 posts
  • Gender:Not Telling

Posted 21 January 2008 - 07:31 AM

A few pointers for this, register globals would have to be on for this to work, otherwise you would need to do $sys = $_POST['sys'], or just use the $_POST['sys'].

Also to reduce the security risk, have an array of safe commands to run, do a check to see if the command that is trying to be run is within that array, if it is, run it, if it isn't, kill the script.

Matt




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users