redhat

What would cause PHP variables to be rewritten by the server?

我的未来我决定 提交于 2019-12-04 02:09:37
I was given a VM at my company to install web software on. But I came across a rather bizarre issue where PHP variables would be overwritten (rewritten) by the server if they matched a specific pattern. What could rewrite PHP variables like this? The following is as an entire standalone script. <?php $foo = 'b.domain.com'; echo $foo; // 'dev01.sandbox.b.domain.com' $bar = 'dev01.sandbox.domain.com'; echo $bar; // 'dev01.sandbox.sandbox.domain.com' $var = 'b.domainfoo.com'; echo $var; // 'b.domainfoo.com' (not overwritten because it didn't match whatever RegEx has been set) ?> Essentially any

redhat6.4配置centos6 yum替换

限于喜欢 提交于 2019-12-03 21:46:58
redhat6.4配置centos6 yum替换 1、卸载掉系统redhat自带的yum rpm -qa |grep yum |xargs rpm -e --nodeps 2 下载 相关的centos yum插件 主要有python-iniparse-0.3.1-2.1.el6.noarch.rpm yum-3.2.29-40.el6.centos.noarch.rpm yum-metadata-parser-1.1.2-16.el6.x86_64.rpm yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm 其中版本号和安装的 系统 版本,以及时32位系统和64位系统有关系 下载地址:http://mirrors.163.com/centos/ 在linux可以使用命令直接下载到本地也可以 wget http://mirrors.163.com/centos/6/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm wget http://mirrors.163.com

When and Why run alternatives --install java jar javac javaws on installing jdk in linux

孤街醉人 提交于 2019-12-03 12:22:52
To install java in linux (I used CentOS, RHEL is same too), I used this command rpm -Uvh /path/to/binary/jdk-7u55-linux-x64.rpm and verified java java -version Looking at a tutorial, it says to run following 4 commands, not sure why ## java ## alternatives --install /usr/bin/java java /usr/java/latest/jre/bin/java 200000 ## javaws ## alternatives --install /usr/bin/javaws javaws /usr/java/latest/jre/bin/javaws 200000 ## Install javac only alternatives --install /usr/bin/javac javac /usr/java/latest/bin/javac 200000 ## jar ## alternatives --install /usr/bin/jar jar /usr/java/latest/bin/jar

Permanently enable RHEL scl

牧云@^-^@ 提交于 2019-12-03 11:15:03
问题 Is there a way to permanently enable custom Software Collections for RedHat? I have installed an scl to provide python27 in RHEL6 and don't want to have to enable the custom scl every time. 回答1: Well, you could add something to your startup script to source the enable script. Eg add to your .bash_profile (note space between initial dot and / ) . /opt/rh/python27/enable 回答2: This option sounds dangerous to me for root. I would think something like the following would be safer and more

redhat 7.6 iptables 配置

笑着哭i 提交于 2019-12-03 10:47:53
1.查看iptables默认表(filter) iptables -L -n 2.iptables 默认内链(filter)表三种: INPUT:处理进入防火墙的数据包 FORWARD:源自其他计算机,不接受到防火墙,而是转发(路由) OUTPUT:处理防火墙发出的数据包 3.添加规则,拒绝icmp协议数据包 iptables -A INPUT -p icmp -j DROP //-A [策略] -p [协议] -j [动作](DROP丢弃、ACCEPT允许、REJECT拒绝) 这里是删除刚才添加的规则 iptables -D INPUT 5 // 这里数字为什么是5,是因为INPUT策略,我们刚才添加的策略从上往下数,在第5行 4.对某个IP进行禁用规则 iptables -A INPUT -s 192.168.72.130 -p tcp --dport 22 -j DROP //这里对指定的IP端口号DROP 5.设置默认规则,过滤所有数据包,直接DROP //我这里先设置了允许22号端口,以免ssh无法连接 iptables -t filter -P INPUT DROP //看红箭头默认是ACCEPT ,设置默认为DROP ,所有过来的数据包都会被DROP = 6.插入规则,因为规则是根据 由上到下排序匹配 的,所有有时候我们要在中间插入规则 iptables -I

PHP is_writable() function always returns false for a writable directory

陌路散爱 提交于 2019-12-03 10:45:44
I'm trying to install a PHP-based software package in a Red Hat 7 Amazon EC2 instance (ami-8cff51fb) that has had Apache 2.4.6 and PHP 5.4.16 installed on it using yum. The installation fails because it says a particular directory needs to be writable by the webserver with 0755 or 0775 permissions. The directory in question has 0775 permissions with root:apache ownership. I have verified that the httpd process is being run by the apache user and that the apache user is a member of the apache group. If I edit /etc/passwd to temporarily give the apache user a login shell and then su to that

Jenkins / Hudson CI Minimum Requirements for a linux RH installation

夙愿已清 提交于 2019-12-03 10:32:35
We are planning on using Jenkins (used to be Hudson) for the automated builds of our project. I need to find out what it needs from a system requirements standpoint (RAM, disk, CPU) for a Linux RH installation. We will be testing a Mobile application project. I did check this post but couldn't find a response. LeysS I've been maintaining a Jenkins / Sonar / Nexus and I pointed out a minimal configuration (Debian 5): CPU : n/a (bye bye plain old school CPU at least ;) ) RAM : 1GB (I prefer 2) HDD : depends on the needs. For my use, a 8 module J2EE Maven project + db scripts (6500 lines of code)

第二届红帽杯线上初赛 RedHat 2018 WriteUp

假装没事ソ 提交于 2019-12-03 10:19:20
又是一个划水的比赛,作看高中生吊打全场orz,太强了。 WEB simple upload 进入一个登陆页面,抓包之后发现cookie有admin=0 改成1之后进入了一个上传页面,获取指纹之后,明显是Apache Tomcat,传一个一句话asp马过去试试。上传yulige.jsp.jpg <% if ( "023" .equals(request.getParameter( "pwd" ))){ java.io.InputStream in = Runtime.getRuntime().exec(request.getParameter( "i" )).getInputStream(); int a = - 1 ; byte [] b = new byte [ 2048 ]; out.print( "<pre>" ); while ((a=in.read(b))!=- 1 ){ out.println( new String(b)); } out.print( "</pre>" ); } %> 抓包,然后把.jpg去掉,发现成功上传。 然后蚁剑连接。在根目录下拿到flag。 flag{20c9076c-b3b3-4f33-b75e-12040779ee19} shopping log 进去页面之后查看源代码,发现指向了 tmvb.com ,跳转到那个页面之后发现是域名出售

Redhat修改yum配置使用CentOS的源

大城市里の小女人 提交于 2019-12-03 09:22:30
由于 redhat 的yum在线更新是收费的,如果没有注册的话不能使用,如果要使用,需将redhat的yum卸载后,重启 安装 ,再配置其他源,以下为详细过程: 1.删除redhat原有的yum rpm -aq|grep yum|xargs rpm -e --nodeps 2.下载yum安装文件 wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-3.2.27-14.el6.centos.noarch.rpm wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-metadata-parser-1.1.2-14.1.el6.x86_64.rpm wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.26-11.el6.noarch.rpm wget http://mirrors.163.com/centos/6/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm 3.进行安装yum rpm -ivh python-iniparse-0.3.1-2.1.el6

RedHat 6/Oracle Linux 6 is not allowing key authentication via ssh

雨燕双飞 提交于 2019-12-03 09:15:51
问题 Keys are properly deployed in ~/.ssh/authorized_keys Yet ssh keeps on prompting for a password. 回答1: Several issues, mostly privileges - but also related to SELinux on RedHat 6 The following script should fix them all, please replace <user>:<group> with your matching userid and group chown -R <user>:<group> ~/.ssh chmod 700 ~/.ssh chmod 600 ~/.ssh/* restorecon -R -v ~/.ssh 回答2: I'd agree with the changes above working on most linux variants in the root account. I have had a problem with