實際上,在" />

国产成人精品无码青草_亚洲国产美女精品久久久久∴_欧美人与鲁交大毛片免费_国产果冻豆传媒麻婆精东

18143453325 在線咨詢 在線咨詢
18143453325 在線咨詢
所在位置: 首頁 > 營銷資訊 > 網(wǎng)站運營 > python登錄自己搭建的網(wǎng)站

python登錄自己搭建的網(wǎng)站

時間:2022-08-22 14:00:01 | 來源:網(wǎng)站運營

時間:2022-08-22 14:00:01 來源:網(wǎng)站運營

基于前陣子我寫的HTTP DoS發(fā)生程序,改寫了一下,實現(xiàn)登錄自己搭建的web滲透測試網(wǎng)站。這個網(wǎng)站叫MYZOO,我讀研一時候,老師提供的一個實驗網(wǎng)站,用來學(xué)習(xí)Web安全,一個微型的交易網(wǎng)站,可以實現(xiàn)更新簡介,查詢,轉(zhuǎn)賬操作。

實際上,在我們所謂的黑客看來,就是Get請求,Post請求嘛,基于這個:

login 函數(shù):用來登錄,獲取cookie和connect句柄
profile 函數(shù):一個POST請求,用來更新數(shù)據(jù)庫中的個人簡介
query 函數(shù):一個GET請求,用來向數(shù)據(jù)庫查詢個人ZOOBAR信息
以上三個算是核心函數(shù)了,雖然實現(xiàn)了登錄,訪問,查詢,退出。但是呢?還是感覺沒啥味道!然而,這通常是小白邁向Web安全,走向傳奇黑客的必經(jīng)之路。誰不是這么走過來的呢?

CSRF跨站請求偽造, XSS 跨站腳本攻擊,SQL注入攻擊,等都是基于對網(wǎng)站有一定的了解,那么怎么就叫對網(wǎng)站有一定的了解呢? 我的回答是:

1.會自己搭建網(wǎng)站
2.會寫爬蟲訪問自己的網(wǎng)站
某些我的讀者,私信咨詢怎么學(xué)習(xí)黑客?這個話題太大,我很難回答好。本站現(xiàn)在的學(xué)術(shù)氛圍越來越不友好了,答題就加分,不答題就減分。那么答題質(zhì)量如何保證呢?越來越水唄。不管是學(xué)習(xí)黑客,還是學(xué)習(xí)其他什么專業(yè)技能,都需要堅持。很多小白都是腦子一熱,找一堆技能樹,黑客教學(xué)視頻,學(xué)了一陣子,就學(xué)不進去了,自然而然的被黑客圈子拒絕在外。

如果非得說個學(xué)習(xí)路線:

科班路線:我還是推薦上學(xué)時期的網(wǎng)絡(luò)安全試驗課目錄,我以前回答過

非科班路線:3年前的看雪論壇,其他幾乎都是種韭菜




我個人感覺:關(guān)注自己喜歡的領(lǐng)域就好,我喜歡黑客的感覺。

堅持向往,慢慢成長,你一定會是矚目的黑客。

#dos.pyimport http.clientimport urllib.parseimport timeclass Dos(object): def __init__(self): pass def login(self,sleepTime,servAddr,url): for i in range(1): time.sleep(sleepTime) try: test_data = {'login_username': '1', 'login_password': '1','submit_login':'Log in'} test_data_url_encode = urllib.parse.urlencode(test_data) conn = http.client.HTTPConnection(servAddr) header = {"Content-type": "application/x-www-form-urlencoded", "Accept": "text/plain"} conn.request(method="POST", url=url, headers=header, body=test_data_url_encode) response = conn.getresponse() #print(response.status) res_head = response.headers set_cookie = res_head.__dict__['_headers'][7] cookie = set_cookie[1].split(';')[0] #print(cookie) res = response.read() #print(res) #conn.close() except IOError as e: print("except:",e) finally: if i % 10 == 0: print("login ok! /ncookie:",cookie) return conn,cookie def profile(self,conn,sleepTime,your_profile,url,req_head): for i in range(1): time.sleep(sleepTime) try: test_data = {'profile_update': your_profile, 'profile_submit': 'Save'} test_data_url_encode = urllib.parse.urlencode(test_data) header = req_head conn.request(method="POST", url=url, headers=header, body=test_data_url_encode) response = conn.getresponse() res = response.read() except IOError as e: print("except:",e) finally: #print('end profile') pass def query(self,conn,sleepTime,url,req_head): for i in range(1): time.sleep(sleepTime) try: header = req_head conn.request(method="GET", url=url, headers=header) response = conn.getresponse() #print(response.status) res = response.read() #print(res) conn.close() except IOError as e: print("except:",e) finally: #print('end profile') passif __name__ == '__main__': servAddr = "172.28.13.40" url = "/myzoo/" url_profile = '/myzoo/index.php' url_query = '/myzoo/users.php?user=1' cookie = '' referer = '' req_header = { 'Accept': 'text / html, application / xhtml + xml, application / xml;q = 0.9, image / webp, image / apng, * / *;q = 0.8', 'Accept-Encoding': 'gzip, deflate', 'Accept-Language': 'zh - CN, zh;q = 0.9', 'Connection': 'keep - alive', 'Cookie': cookie, 'Host': '172.28.13.40', 'Referer': referer, 'Upgrade-Insecure-Requests': '1', 'User-Agent': 'Mozilla / 5.0(WindowsNT6.1;Win64;x64) AppleWebKit / 537.36(KHTML, likeGecko) Chrome / 67.0.3396.87Safari / 537.36' } sleepTime = 0.01 hack = Dos() dev,cookie = hack.login(sleepTime, servAddr, url) for i in range(100): your_profile = str(i) referer = 'http://172.28.13.40/myzoo/users.php' hack.profile(dev,sleepTime, your_profile, url_profile,req_header) referer = 'http://172.28.13.40/myzoo/index.php' hack.query(dev,sleepTime,url_query,req_header)
74
73
25
news

版權(quán)所有? 億企邦 1997-2022 保留一切法律許可權(quán)利。

為了最佳展示效果,本站不支持IE9及以下版本的瀏覽器,建議您使用谷歌Chrome瀏覽器。 點擊下載Chrome瀏覽器
關(guān)閉