国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學(xué)院 > 操作系統(tǒng) > 正文

駭客蜜罐實驗——公網(wǎng)服務(wù)器

2024-06-28 13:26:42
字體:
供稿:網(wǎng)友
駭客蜜罐實驗——公網(wǎng)服務(wù)器

人一生必定會殺一個人 為了最后讓自己死去 我們僅有一次可能性

爺爺?shù)乃罌]有人能承受 最后會去往無盡的虛空

殺人 只有一次 殺了別人 把它用盡后 卻永遠(yuǎn)無法殺死自己 作為一個人 求死不得

——空之境界·兩儀式

最近筆者獲得了一臺公網(wǎng)服務(wù)器的root權(quán)限,按耐不住要做一些好玩的事情了。

學(xué)習(xí)GNU/linux這么長時間了,這是筆者第一次控制一臺真正的公網(wǎng)服務(wù)器。

請訪問http://eecs.cc:8080/測試本文最終結(jié)果,您可以使用ssh客戶端嘗試登陸并刷新頁面進行驗證。

我們開始吧!

第一步:

訪問http://www.openssh.com/下載最新的源碼包,我下的是openssh-6.6p1.tar.gz。

看下圖:

解壓源碼包,打開源碼根下auth2-passwd.c文件,找到上圖中 userauth_passwd 函數(shù)定義所在,添加上面紅色框中的兩行代碼。

yum install -y zlib-devel openssl openssl-devel./configure --with-pid-dir=/usr/local/etc && make && make install

現(xiàn)在配置我們的 ssh daemon 的運行參數(shù):

vim /usr/local/etc/sshd_config
# 重要參數(shù)配置Port 22PRotocol 2HostKey /usr/local/etc/ssh_host_rsa_keySyslogFacility AUTHPRIVLogLevel DEBUGDenyUsers *MaxAuthTries 2PassWordAuthentication yes

啟動‘陷阱’sshd:

/usr/local/sbin/sshd

第二步:

建立web服務(wù)器:

 1 import web 2 import MySQLdb 3 import commands 4  5  6 web.config.debug = False 7 render=web.template.render('templates/') 8 urls = ( 9     "/", "hello",10     "/log","viewlog",11     '/list','list',12     '/secure','secure',13     "(.*)","notfound"14     )15 app = web.application(urls, globals())16 17 class hello:18     def GET(self):19     #name='Jack'20     i=web.input(name=None)21     bb='bobo'22         return render.a(i.name,bb)23 24 class viewlog:25     def GET(self):26         named='log'27     bb='wa'28         return render.a(named,bb)29 30 class notfound:31     def GET(self,path):32         #name='notfound'33     return render.notfound(path)34 35 class list:36     def GET(self):37     conn=MySQLdb.connect(host='172.16.31.99',user='web',passwd='webyun',db='web')38     cur=conn.cursor()39     lis=cur.execute( ' show tables; ' )40     lis=cur.fetchall()41     cur.close()42     conn.close()43     #lis=[1,2,3,'123123',123,'abc' ]44         return render.list(lis)45 46 class secure:47     def GET(self):48         try:49             return commands.getoutput(' grep -E -C 2 ":/)" /var/log/secure ')50         except:51             return 'file access error :('52 53 if __name__ == "__main__":54     app.run()

啟動web服務(wù)器:

nohup python web3c.py 8080 &>log &

最終效果展示:

額。。。

文章短小,卻也花費了一番精力,如有建議和看法,歡迎提出一起討論!


發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 青阳县| 调兵山市| 凤庆县| 高雄市| 晋江市| 会同县| 新河县| 余江县| 塔城市| 卫辉市| 建昌县| 靖西县| 永顺县| 岱山县| 二手房| 庐江县| 萝北县| 镶黄旗| 河北区| 澄江县| 临沂市| 双城市| 承德县| 怀化市| 陆良县| 讷河市| 九江县| 南充市| 富蕴县| 朝阳区| 河南省| 晋中市| 阿荣旗| 定南县| 榆树市| 株洲县| 工布江达县| 台湾省| 扬中市| 宾阳县| 若尔盖县|