This series of tutorials is aimed to share the notes taken while I was learning python for cybersecurity with the books - Black Hat Python.
這系列教學文章為學習筆記+延伸資源,旨在分享學習書籍 Black Hat Python時所思所學,也希望能幫助想了解Python和資安的大大們入門。
This tutorail has also been written in English in Medium.
Let's get started! 開始吧!
def main():
    if len(sys.argv[1:]) != 5:
        print("Usage: ./proxy.py [localhost] [localport]", end='')
        print("[remotehost] [remoteport] [receive_first]")
        print("Example: ./proxy.py 127.0.0.1 9000 10.12.132.1 9000 True")
        sys.exit(0)
    
    local_host = sys.argv[1]
    local_port = int(sys.argv[2])
    remote_host = sys.argv[3]
    remote_port = int(sys.argv[4])
    receive_first = sys.argv[5]
    if "True" in receive_first:
        receive_first = True
    else:
        receive_first = False
    server_loop(local_host, local_port,
                remote_host, remote_port, receive_first)
if __name__ == '__main__':
    main()
接收一些指令列參數,並開始伺服器迴圈,以便用來聆聽連接。
Take in some command line arguments and then fire up the server loop that listens for connections.
在我的Github | Python for Cybersecurity
打開兩個Terminal Emulators
其中一個 Teminal Emulator
另一個
等一小段時間後,你會需要登入:
Username | anonymous
Password | anonymous

成功登入

Reference參考資料
推薦影片
絕讚! Youtube 教學影片 | Elevate Cyber
原始碼
Github - Python For Cybersecurity | Monles