PDA

Просмотр полной версии : запуск приложений через php, требующих ввод данных


kay_rus
18.02.2008, 13:27
как запустить приложение через php, чтобы с ним можно было работать как через терминал.

например rfr pfgecnbnm банальный ncftp?

пробовал вариации с proc_open, а также PHPShell, но ничего не получается.

Isis
18.02.2008, 14:26
system

Или вот что я нашел:
Article 9818 of comp.lang.perl:
Xref: feenix.metronet.com comp.lang.perl:9818 alt.sources:2646
Path: feenix.metronet.com!internet.spss.com!insosf1.info net.net!news-feed-1.peachnet.edu!news-feed-2.peachnet.edu!emory!europa.eng.gtefsd.com!howland .reston.ans.net!news.intercon.com!udel!gramps.itd. com!ma.itd.com!jblaine
From: jblaine@ma.itd.com (Jeff Blaine)
Newsgroups: comp.lang.perl,alt.sources
Subject: iarchie: An interactive backend to archie, frontend to NcFTP
Date: 16 Jan 1994 07:24:28 GMT
Organization: Space Remote Sensing Center
Lines: 104
Distribution: world
Message-ID: <2haq3c$jnm@gramps.itd.com>
NNTP-Posting-Host: ma.itd.com

This is a backend to archie (slash) frontend to NcFTP.
You must have archie and NcFTP to make use of this script (as well as perl).
Let me know what you think.

#!/usr/local/bin/perl
#
# Interactive Archie for terminals.
# Jeff Blaine, 1994, jblaine@ma.itd.com
#
# READ THIS:
# This is NOT an archie implementation. You must have archie
# installed as well as NcFTP to use this perl code to interactively
# (ahem) search for and retrieve files.
#
# You can get NcFTP from cse.unl.edu:/pub/mgleason/ncftp
# You can get archie from nic.sura.net:/pub/archie/clients
#
# iarchie should be called exactly like your copy of archie (same
# args you always use). Example usage:
#
# prompt% iarchie -h archie.ans.net filename.tar.Z
#
# Please see the end of this Perl script for more commented information.
#
# INSTALLER: Define NCFTP to point to your copy of NcFTP. That's all.
$NCFTP = '/usr/code/sun/bin/ncftp';

$VERSION = '1.0';

$ia_tmp = "iarchie.tmp";
$0 = iarchie;
$| = 1; # Flush stdout on all writes.

if ($ARGV[0] eq "") {
&usage;
exit (1);
}
print "Connecting to archie server and retrieving information...\n";
print "";
unlink ("$ia_tmp"); # Remove any old temp file.
system ("archie -l @ARGV > $ia_tmp"); # Call archie.
&parse_archie; # Parse output from archie.
&print15; # Menu and select.
unlink ("$ia_tmp"); # Remove temp file.

sub usage {
print "Usage:\n";
print " $0 uses all of the same options as the c-archie package.\n";
print " Type 'man archie' to see those options.\n";
}

sub parse_archie {
open (INFILE, "$ia_tmp") || die "Couldn't open $ia_tmp\n";
while (<INFILE>) {
if ($_ ne '\n') {
@curr = split;
$ncftp_line = $curr[2] . ":" . $curr[3];
$ncftp_line = "$ncftp_line\n";
push (@ncftp_lines, $ncftp_line);
}
}
close (INFILE);
print "\n";
}

sub print15 {
$num = 0;
while ($num != 15) {
print "$num ) ", $ncftp_lines[$num];
$num++;
}
print "\n";
print "Enter a number or 'q' to quit: ";
$ch = getc;
if ($ch eq "q") {
exit (0);
} elsif ($ch =~ /[0-15]/) {
print "FTPing Number $ch : ", $ncftp_lines[$ch];
print "Please wait.";
chop ($ncftp_lines[$ch]);
system ("$NCFTP $ncftp_lines[$ch]");
} else {
&print15;
}
}

# TODO: Make iarchie check args sent to it to match those valid ones
# allowed by the archie program.
#
# Allow for more than 15 shown matches (add a 'n' for next page
# command)
#
# Write a man page.
#
# This code is by no means to be depended on. It seems to work well
# for me, and I feel that others will benefit from it, so I am posting
# it for others to use who have Perl, archie, and NcFTP installed.
#
# If you want to hack the hell out of it, be my guest. If you release
# a modified version of this iarchie perl script, please be kind and
# mention my name, Jeff Blaine somewhere.
--
J e f f B l a i n e jblaine@ma.itd.com
Perl code: checksummed line-noise with a mission in life. -- R.L. Schwartz

kay_rus
19.02.2008, 14:43
я ncftp только в качестве примера привел.
основная задача - запустить недавно выложенный эксплоит для linux 2.6.17-2.6.24.1 и запустить команду под рутом.

desTiny
19.02.2008, 19:53
ага=) и команду password=)

Isis
20.02.2008, 02:34
kay_rus, через пхп запустить экспойт на перле?
Или я не догнал

ShAnKaR
20.02.2008, 18:48
переписать сплоит чтоб он не bash запускал а что тебе нужно.