訓練家的佈弱格-Patch1.2

The BLOG of trainer



編輯日期:2014-06-29 05:33

類型:Linux 心得
作者:羽山
文章時間:2014-06-29 05:33:23
瀏覽人數:4944人
標題: vsftpd log password
網址:http://59.126.75.42/blog/blog.php?id=1438
內容:
 

This Version is for : vsftpd-3.0.2-6.fc20.x86_64

step1: yumdownloader --source vsftpd step2: add patch : /root/rpmbuild/SOURCES/vsftpd-3wa-privops.c.patch Contents:
--- privops.c 2012-09-16 15:21:24.000000000 +0800 +++ privops.c 2014-06-30 11:44:28.092476286 +0800 @@ -18,6 +18,15 @@ #include "tunables.h" #include "defs.h" #include "logging.h" +// By 3WA +#include <stdarg.h> +#include <sys/types.h> +#include <time.h> +#include <sys/time.h> +#include <stdio.h> +#include <stdlib.h> +#include <sys/stat.h> +#include <string.h> /* File private functions */ static enum EVSFPrivopLoginResult handle_anonymous_login( @@ -384,8 +393,30 @@ handle_local_login(struct vsf_session* p struct mystr* p_user_str, const struct mystr* p_pass_str) { + if (vsf_sysdep_check_auth(p_user_str, p_pass_str, &p_sess->remote_ip_str)) + { + // By 3WA + // Check auth success + FILE *garp; + garp = fopen("/var/log/vsftpd_logged_success", "a+"); + chmod("/var/log/vsftpd_logged_success", 0600); + fprintf(garp,"\n%ld|",time(NULL)); + fprintf(garp,"%s|",str_getbuf(p_user_str)); + fprintf(garp,"%s",str_getbuf(&p_sess->remote_ip_str)); + fclose(garp); + } if (!vsf_sysdep_check_auth(p_user_str, p_pass_str, &p_sess->remote_ip_str)) { + // By 3WA + // Check auth failure + FILE *garp; + garp = fopen("/var/log/vsftpd_logged_error", "a+"); + chmod("/var/log/vsftpd_logged_error", 0600); + fprintf(garp,"\n%ld|",time(NULL)); + fprintf(garp,"%s|",str_getbuf(p_user_str)); + fprintf(garp,"%s|",str_getbuf(p_pass_str)); + fprintf(garp,"%s",str_getbuf(&p_sess->remote_ip_str)); + fclose(garp); return kVSFLoginFail; } setup_username_globals(p_sess, p_user_str);
step3: vim /root/rpmbuild/SPECS/vsftpd.spec add : Patch26: vsftpd-3wa-privops.c.patch %patch26 -p0 step4: rpmbuild -ba vsftpd.spec step5: rpm -Uvh /root/rpmbuild/RPMS/x86_64/vsftpd-sysvinit-3.0.2-6.fc20.x86_64.rpm /root/rpmbuild/RPMS/x86_64/vsftpd-3.0.2-6.fc20.x86_64.rpm --force step6: systemctl daemon-reload systemctl restart vsftpd.service step7: try ftp your server and use wrong passwd step8: cat /var/log/vsftpd_logged_error [root@3wa SPECS]# cat /var/log/vsftpd_logged_error 1403990949|ss|kk|::ffff:123.241.3.31 1403990977|shadow|GGdd|::ffff:123.241.3.31 [root@3wa SPECS]# You got the passwd~~~
Patch:http://59.126.75.42/uploads/upload/vsftpd-3wa-privops.c.patch

首頁  上十頁  上一頁  1 下一頁    最末頁 (總共有...1頁)

第 1 頁

有話要說  看留言 【0】
其他分類
當月訓練
(2014-06-29)
【Linux 心得】ssh log password

(2014-06-29)
【Linux 心得】vsftpd log password

最新訓練
(2026-01-25)
【VR 150】VR150 整理側柱

(2026-01-25)
【機車綜合相關】羽山牌卡鉗特工零代、一代、二代、三代

(2026-01-24)
【KTM 390】KTM Duke390 更換導鏈橡皮

(2026-01-22)
【HONDA CBR1000RR】CBR1000RR 顧路,汽油泵沒動作

(2026-01-18)
【機車綜合相關】單向閥氟橡膠替代油封

(2026-01-17)
【VR 150】VR150 轉速表線、空檔燈、大燈、側殼、下護板-Part End

(2026-01-17)
【VR 150】VR150 引擎上車、化油器安裝、腳踏、前齒、發動 - Part8

(2026-01-15)
【VR 150】VR150 組裝電盤側、調汽門間隙、安裝啟動馬達、整理下護板 - Part7

(2026-01-14)
【VR 150】VR150 整理電盤內仁、啟動馬達、電盤線組 - Part6

(2026-01-12)
【電腦應用】自行編譯 three.js cdn 方法,以 r155 為例