Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Bir neçə dəfə qarşıma bəzi serverlər çıxıb ki,serverdəki hər hansı sayta girişib shell atmağa qədər nail olmuşam.
- Lakin upload edilən shell heç bir halda code executiona gətirməyib.Əvəzinə hər dəfə İnternal server error almışam.
- Özü də onu deyim ki,eyni serverdə müxtəlif növ /müxtəlif cms-li saytlara qarşı eyni problem davam edib.
- Səbəbi araşdırdıqda bəlli olduki bu suphp-dən qaynaqlanır.Çox kiçik trick etməklə server admin serverə shell girməsinin qarşısını almağa çalışıb.
- Tam qarantlı metod deyil bu lakin onu deyim ki,attackeri yorandır və attacker daha çox əziyyət çəkməli olur.Müəyyən qədər olsa da attackerin müvəffəqiyyətli code execution almasının qarşısını alır.
- Test etdiyim configurasiya:
- [code]
- [root@ html]# httpd -V
- Server version: Apache/2.4.10 (Fedora)
- Server built: Sep 3 2014 14:49:30
- Server's Module Magic Number: 20120211:36
- Server loaded: APR 1.5.1, APR-UTIL 1.5.4
- Compiled using: APR 1.5.1, APR-UTIL 1.5.3
- Architecture: 64-bit
- Server MPM: prefork
- threaded: no
- forked: yes (variable process count)
- Server compiled with....
- -D APR_HAS_SENDFILE
- -D APR_HAS_MMAP
- -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
- -D APR_USE_SYSVSEM_SERIALIZE
- -D APR_USE_PTHREAD_SERIALIZE
- -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
- -D APR_HAS_OTHER_CHILD
- -D AP_HAVE_RELIABLE_PIPED_LOGS
- -D DYNAMIC_MODULE_LIMIT=256
- -D HTTPD_ROOT="/etc/httpd"
- -D SUEXEC_BIN="/usr/sbin/suexec"
- -D DEFAULT_PIDLOG="/run/httpd/httpd.pid"
- -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
- -D DEFAULT_ERRORLOG="logs/error_log"
- -D AP_TYPES_CONFIG_FILE="conf/mime.types"
- -D SERVER_CONFIG_FILE="conf/httpd.conf"
- [root@ html]# umask -S
- u=rwx,g=rx,o=rx
- [root@ html]# cat /etc/suphp.conf|grep -i -A 5 -B 5 "0013"
- ;PATH environment variable
- env_path=/bin:/usr/bin
- ;Umask to set, specify in octal notation
- umask=0013
- ;#kohne umask=0077
- ;#0011 test
- ; Minimum UID
- [/code]
- Fikir verdinizsə umask burada 0013 vermişəm.
- Məhz attackerin içini çətinləşdirən də umask 0013 -dür.
- [img]http://s020.radikal.ru/i701/1502/61/212438b50822.png[/img]
- [img]http://s009.radikal.ru/i307/1502/90/9a308cfd811e.png[/img]
- [img]http://s019.radikal.ru/i632/1502/2e/610f01ed5f29.png[/img]
- [root@ html]# cat codeexec.php
- <?php
- die('<h1>isleyir?');
- ?>
- [root@ html]# php -l codeexec.php
- No syntax errors detected in codeexec.php
- [root@ html]# tail -f /var/log/httpd/error_log
- [Fri Feb 20 00:38:03.042739 2015] [:error] [pid 7839] [client 127.0.0.1:39862] SoftException in Application.cpp:262: File "/var/www/html/codeexec.php" is writeable by group
- [Fri Feb 20 00:38:03.042806 2015] [core:error] [pid 7839] [client 127.0.0.1:39862] End of script output before headers: codeexec.php
- [Fri Feb 20 00:38:05.387049 2015] [:error] [pid 7862] [client 127.0.0.1:39863] SoftException in Application.cpp:262: File "/var/www/html/codeexec.php" is writeable by group
- [Fri Feb 20 00:38:05.387137 2015] [core:error] [pid 7862] [client 127.0.0.1:39863] End of script output before headers: codeexec.php
- [Fri Feb 20 00:38:16.060319 2015] [:error] [pid 7835] [client 127.0.0.1:39865] SoftException in Application.cpp:262: File "/var/www/html/codeexec.php" is writeable by group
- [Fri Feb 20 00:38:16.060372 2015] [core:error] [pid 7835] [client 127.0.0.1:39865] End of script output before headers: codeexec.php
- Bir daha qeyd edirəm ki,bu metod remote shell upload tipli vulnlarda xüsusilə uploaddan sonra faylın üzərində skript tərəfindən chmod əməliyyatı aparılmayan attack vektorlarına qarşı effektivdir.
- Ümüdvaram çox adamın işinə yarıyar.Xüsusilə server adminlərin işinə.
- (c) Anti-armenia.ORG Team
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement