国产探花免费观看_亚洲丰满少妇自慰呻吟_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ā)表
主站蜘蛛池模板: 三原县| 古丈县| 金川县| 潮州市| 揭西县| 金秀| 南涧| 日照市| 武冈市| 锡林郭勒盟| 郴州市| 寻甸| 嘉义市| 宁德市| 苍南县| 青河县| 民勤县| 兴文县| 江孜县| 桑植县| 将乐县| 满洲里市| 高碑店市| 毕节市| 上虞市| 宜宾市| 高清| 阿城市| 铜川市| 湾仔区| 罗城| 土默特左旗| 德安县| 云安县| 禹州市| 东宁县| 金乡县| 礼泉县| 巴塘县| 泾源县| 彭水|