cgi

Tomcat CGIServlet enableCmdLineArguments远程代码执行_CVE-2019-0232漏洞复现

匿名 (未验证) 提交于 2019-12-02 23:49:02
Tomcat CGIServlet enableCmdLineArguments远程代码执行_CVE-2019-0232漏洞复现 一、漏洞描述 该漏洞是由于tomcat CGI将命令行参数传递给Windows程序的方式存在错误,使得CGIServlet被命令注入影响。成功利用此漏洞可允许远程攻击者在目标服务器上执行任意命令,从而导致服务器被完全控制。 该漏洞只影响windows平台,要求启用CGI Servlet和enableCmdLineArguments参数。但是CGI Servlet默认关闭, enableCmdLineArguments在tomcat 9.0之后默认关闭 触发该漏洞需要同时满足以下条件: 1、 系统为windows 2、 启用了CGI Servlet(默认为关闭) 3、 启用了enableCmdLineArguments(tomcat 9.0之后默认为关闭) 二、影响版本 Apache Tomcat 9.0.0.M1 to 9.0.17 Apache Tomcat 8.5.0 to 8.5.39 Apache Tomcat 7.0.0 to 7.0.93 三、漏洞环境 目标机:windows 7 jdk_8u71 apache tomcat 8.5.2 1、 java环境搭建,jdk下载、安装 下载地址:http://www.oracle.com

Software error while executing CGI script

孤人 提交于 2019-12-02 23:37:32
问题 I have a cgi script for upload which is as follows #!/usr/bin/perl use CGI; use CGI::Carp qw(fatalsToBrowser); my $cgi = new CGI; my $file = $cgi->param('file'); $file=~m/^.*(\\|\/)(.*)/; # strip the remote path and keep the filename my $name = $2; open(LOCAL, ">/home/Desktop/$name") or die $!; while(<$file>) { $data .= $_; } print $cgi->header(); print "$file has been successfully uploaded... thank you.\n"; print $data; The HTML file is as follows <html> <head> <title>Test</title> </head>

Java CGI vs. Servlets [closed]

南楼画角 提交于 2019-12-02 23:02:23
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. What are the main differences between CGI and Java servlets? Servlets are run in one process (HTTP server with additional features, which called Servlet Container) and they exist as long as that process exists. CGI means every time there's client request,

python CGI

匿名 (未验证) 提交于 2019-12-02 22:51:30
第一步 :开启 Apache 第二步 :开启 CGIHTTPServer 。打开 cmd,切换到 Apache 的 bin 同目录下,输入 python -m http.server --cgi 8080(这个是CGI服务器的端口,不写的话默认是8000端口) 第三步 :映射到页面上。打开Apache目录下的cgi-bin文件夹(这是存放文件的默认文件夹),编写程序。然后打开浏览器,输入 1 #!D:\Program Files\python37\python.exe 2 #coding=utf-8 3 print("Content-type:text/html\n\n") 4 print() 5 print('hello world!') test.py 踩过的坑: Apache 配置出现‘TLS1.3错误’解决办法:不要安装64位Apache,改安装32位,如下图 来源:博客园 作者: 思念女儿国的唐僧 链接:https://www.cnblogs.com/liumin6634/p/11483442.html

xampp2016-apache2.4.18-配置python cgi-bin

匿名 (未验证) 提交于 2019-12-02 22:51:30
为了配置python cgi-bin,遇到了好多坑,403,404,500等报错。 先将配置过程记录如下: 环境: 1.xampp 2016 2.apache2.4.18 过程: 1.在xampp目录下新建cgi-bin文件夹(如果没有cgi-bin文件夹)。 2.新建测试用的python脚本,如hello.py, 代码如下: 1 #!G:/python3.6/python.exe 2 # -*- coding: utf-8 -*- 3 print("Content-type:text/html") 4 print() # 空行,告诉服务器结束头部 5 print('<html>') 6 print('<head>') 7 print('<meta charset="utf-8">') 8 print('<title>HelloCGI Program!</title>') 9 print('</head>') 10 print('<body>') 11 print('<h2>Hello Word! CGI PROGRAM</h2>') 12 print('</body>') 13 print('</html>') 3.修改 xampp\apache\conf\httpd.conf 文件 https://www.cnblogs.com/feifeidxl/p/5556696.html

python CGI编程---Apache服务安装

匿名 (未验证) 提交于 2019-12-02 22:51:30
  一、下载Apache   下载地址: https://www.apachehaus.com/cgi-bin/download.plx            我这里下载第一个,我电脑是window的64位。          下载完成后,解压到                      我在这个文件夹下新加了个文件夹python,把Apache24文件夹放到它里面,所以就成了C:\httpd-2.4.39-o102s-x64-vc14\python\Apache24           进入C:\httpd-2.4.39-o102s-x64-vc14\python\Apache24\conf文件夹中找到httpd.conf文件。打开修改配置,                      SRVROOT后面修改成你文件夹的路径         三、启动Apache服务           在C:\httpd-2.4.39-o102s-x64-vc14\python\Apache24\bin文件夹下找到ApacheMonitor.exe应用程序,双击,在你电脑上桌面右下角会出现图标,打开窗口界面并启动apache24服务                    四、测试服务成功           打开python开发工具,打开C:\httpd-2.4.39-o102s-x64-vc14

CGI+APACHE+PYTHON配置

若如初见. 提交于 2019-12-02 22:43:36
CGI+APACHE+PYTHON 现在因为已经安装了2.6的Python,以及支持2.6的Eric4,就不想再重新安装2.5来继续配置Apache下mod_python了。 后来发现了一篇文章Running Python as CGI in Apache in Windows ,讲述以CGI模式代替mod_python来运行python script。还有这篇Python for Windows 。 做法是: 打开httpd.conf,找到”#ScriptInterpreterSource Registry “,移除前面的注释# (如果找不到这行,就自己添加进去) 找到“Options Indexes FollowSymLinks ”这句,在后面加上”ExecCGI “。(那个”Indexes “最好也能去掉,因为如果不去掉的话,目录下面没有index.html这种文件,就会显示出目录列表下的所有文件,所以有安全漏洞问题。如果去掉Indexes,而且没有index.html文件的话,就会显示一个Forbidden页面) 找到”AddHandler cgi-script .cgi “,在后面加上 .py。如果没有这句,可以自己添加 “AddHandler cgi-script .py” 重新启动Apache即可 (有的时候restart会导致Apache死掉

PHP TS 和 NTS 版本选择

匿名 (未验证) 提交于 2019-12-02 22:10:10
在PHP 开发和生产环境搭建过程中,需要安装PHP语言解析器。官方提供了2种类型的版本,线程安全(TS)版和非线程安全(NTS)版,有时后我们开发环境和实际生产的环境有所不同,因此也需要选择安装对应的PHP版本。 在此记录下笔记,方便日后查看 ... 1、简介 TS:   TS( Thread-Safety )即线程安全,多线程访问时,采用了加锁机制,当一个线程访问该类的某个数据时进行数据加锁保护,其他线程不能同时进行访问该数据,直到该线程读取完毕,其他线程才可访问使用该数据,好处是不会出现数据不一致或者数据污染的情况,但耗费的时间要比 NTS 长。   PHP以 ISAPI 方式(Apache 常用方式)加载的时候选择TS版本。 NTS:   NTS( None-Thread Safe )即非线程安全,不提供数据访问保护,有可能出现多个线程先后或同时操作同一数据的情况,容易造成数据错乱(即脏数据),一般操作的执行时间要比 TS 短。   PHP以FAST-CGI方式加载运行的时候选择TNS版,具有更好的性能;    ISAPI:   ISAPI( Internet Server Application Programming Interface ), 通常是指被http服务器所加载,以服务器的 模块形式运行 ,由微 软提出,故只能在win平台上运行,如win下的apache

Pros and Cons of different approaches to web programming in Python

a 夏天 提交于 2019-12-02 18:59:57
I'd like to do some server-side scripting using Python. But I'm kind of lost with the number of ways to do that. It starts with the do-it-yourself CGI approach and it seems to end with some pretty robust frameworks that would basically do all the job themselves. And a huge lot of stuff in between, like web.py , Pyroxide and Django . What are the pros and cons of the frameworks or approaches that you've worked on ? What trade-offs are there? For what kind of projects they do well and for what they don't? Edit: I haven't got much experience with web programing yet. I would like to avoid the

Output images to html using python

北战南征 提交于 2019-12-02 18:29:43
I have a webpage generated from python that works as it should, using: print 'Content-type: text/html\n\n' print "" # blank line, end of headers print '<link href="default.css" rel="stylesheet" type="text/css" />' print "<html><head>" I want to add images to this webpage, but when I do this: sys.stdout.write( "Content-type: image/png\n\n" + file("11.png","rb").read() ) print 'Content-type: text/html\n\n' print "" # blank line, end of headers print '<link href="default.css" rel="stylesheet" type="text/css" />' ... All I get is the image, then if I place the image code below my html/text header