diff --git a/python/bhp/tcp_client.py b/python/bhp/Chapter-02/tcp_client.py similarity index 70% rename from python/bhp/tcp_client.py rename to python/bhp/Chapter-02/tcp_client.py index 025ebf0..b89350b 100644 --- a/python/bhp/tcp_client.py +++ b/python/bhp/Chapter-02/tcp_client.py @@ -1,7 +1,7 @@ import socket targetHost = "127.0.0.1" -targetPort = 80 +targetPort = 9999 print(targetHost) #create a socket object @@ -13,11 +13,14 @@ client.connect((targetHost, targetPort)) #send some data message = "GET / HTTP/1.1\r\nHost: google.com\r\n\r\n" #we have to encode our string using UTF-8 -#client.send(message.encode("utf-8")) +client.send(message.encode("utf-8")) +#client.send(b"GET / HTTP/1.1\r\nHost: google.com\r\n\r\n") ##THIS LINE ENCODE THE STRING AT UTF-8 using the 'b' #receive some data response = client.recv(4096) #This is the amount of bytes you want to read!! +client.close() + #print the response print(response) \ No newline at end of file diff --git a/python/bhp/banner_grab.py b/python/bhp/junk/banner_grab.py similarity index 93% rename from python/bhp/banner_grab.py rename to python/bhp/junk/banner_grab.py index 5cebe6c..eb06ebe 100755 --- a/python/bhp/banner_grab.py +++ b/python/bhp/junk/banner_grab.py @@ -2,7 +2,7 @@ import socket targetHost = "127.0.0.1" -targetPort = 22 +targetPort = 9999 print(targetHost) #create a socket object @@ -21,4 +21,4 @@ message = "GET / HTTP/1.1\r\nHost: google.com\r\n\r\n" response = client.recv(4096) #This is the amount of bytes you want to read!! #print the response -print(response) \ No newline at end of file +print(response) diff --git a/python/bhp/netcat.py b/python/bhp/junk/netcat.py similarity index 99% rename from python/bhp/netcat.py rename to python/bhp/junk/netcat.py index 49dda52..91456d7 100755 --- a/python/bhp/netcat.py +++ b/python/bhp/junk/netcat.py @@ -91,7 +91,7 @@ def main(): elif o in ("-t","--target"): target = a elif o in ("-p","--port"): - port = (int)a + port = (int) else: assert False,"Unhandled Option" if not listen and len(target) and port > 0: diff --git a/python/bhp/tcp_server.py b/python/bhp/junk/tcp_server.py similarity index 100% rename from python/bhp/tcp_server.py rename to python/bhp/junk/tcp_server.py diff --git a/python/bhp/udp_client.py b/python/bhp/junk/udp_client.py similarity index 100% rename from python/bhp/udp_client.py rename to python/bhp/junk/udp_client.py diff --git a/python/murach-python/.idea/.gitignore b/python/murach-python/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/python/murach-python/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/python/murach-python/.idea/inspectionProfiles/profiles_settings.xml b/python/murach-python/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/python/murach-python/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/python/murach-python/.idea/misc.xml b/python/murach-python/.idea/misc.xml new file mode 100644 index 0000000..d56657a --- /dev/null +++ b/python/murach-python/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/python/murach-python/.idea/modules.xml b/python/murach-python/.idea/modules.xml new file mode 100644 index 0000000..0995b1a --- /dev/null +++ b/python/murach-python/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/python/murach-python/.idea/murach-python.iml b/python/murach-python/.idea/murach-python.iml new file mode 100644 index 0000000..d0876a7 --- /dev/null +++ b/python/murach-python/.idea/murach-python.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/python/murach-python/.idea/vcs.xml b/python/murach-python/.idea/vcs.xml new file mode 100644 index 0000000..b2bdec2 --- /dev/null +++ b/python/murach-python/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/python/murach-python/Section3/Chapter18/gui.py b/python/murach-python/Section3/Chapter18/gui.py new file mode 100644 index 0000000..e69de29