Banner Grabbing Script in Python

twinbaby

Supremacy Member
Joined
Jul 8, 2014
Messages
5,417
Reaction score
1,499
VIM - look very tough for me an my co-worker. But respect u for being able to memorize it like so well.
I don;t use tmux but I used terminator. I still need some mouse control for the time being. I can safely say lot of people I know don't know VIM, but use gedit.

Mark the code executable not good enough for me, I want prefer the execute and build button.

Got negative comments like the typical online "Just google", but I will take in your positive part.
 

davidktw

Arch-Supremacy Member
Joined
Apr 15, 2010
Messages
13,547
Reaction score
1,301
VIM - look very tough for me an my co-worker. But respect u for being able to memorize it like so well.
I don;t use tmux but I used terminator. I still need some mouse control for the time being. I can safely say lot of people I know don't know VIM, but use gedit.

Mark the code executable not good enough for me, I want prefer the execute and build button.

Got negative comments like the typical online "Just google", but I will take in your positive part.

A lot of people don't know a lot of things, the question is do you want to. Don't drag what others cannot or don't as an excuse.
Again what makes you think I'm not selecting using my mouse in VIM ? lol... again you don't know what you don't know.

When you decide to become more, you are welcome.
I show people door, walking through the door is their choice.

:)
 

davidktw

Arch-Supremacy Member
Joined
Apr 15, 2010
Messages
13,547
Reaction score
1,301
I am in the midst of building a multi threaded python server:
print ("Failed to create socket. Error code: " + str(msg[0]) + " , Error message : " + msg[1])
TypeError: 'OSError' object is not subscriptable

2ndly, when I moved the handle_client to the bottom it was not detectable by the while True loop

This response does not answer your above concerns, but just simply show you how an event-driven concurrent HTTP Helloworld server may work.
It's just a small demonstration for you to investigate.

Using Apache Benchmark tool to drive as HTTP client, no issue in handling 100 concurrent connections as shown below.
Disclaimer: Both the demo and testing are simplistic.

7wdS9pv.png

Dr1RwMh.png

bAbSr6K.png

uNg4mYk.png
 
Last edited:

twinbaby

Supremacy Member
Joined
Jul 8, 2014
Messages
5,417
Reaction score
1,499
@twinbaby This is probably what you want

Python:
#! /usr/bin/env python3
import socket
import select

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect (("demo.testfire.net",80))
#send a basic http request
output=b"GET / HTTP/1.0\nHost: demo.testfire.net\n\n"
#s.send(output.encode('utf-8'))
s.send(output)
page = ""
while True:
    ready = select.select([s], [], [], 2)
    if ready[0]:
        data = s.recv(4096)
        if len(data) <= 0 :
            break
        page = page + data.decode('utf-8')
#close the socket and print the results
s.close()
print (page)
I found an easier way, after 2 months.
I guess the above method is to teach us once how socket programming works.
Subsequently, we just use whatever method we are comfortable with.
# importing the requests library
import requests
# api-endpoint
URL = "https://demo.testfire.net"
r = requests.get(url = URL, verify=False)
print(r.text)
 

davidktw

Arch-Supremacy Member
Joined
Apr 15, 2010
Messages
13,547
Reaction score
1,301
I found an easier way, after 2 months.
I guess the above method is to teach us once how socket programming works.
Subsequently, we just use whatever method we are comfortable with.
Which I have already told you in post #2.
If curl works for you, why not.
:)
 
Important Forum Advisory Note
This forum is moderated by volunteer moderators who will react only to members' feedback on posts. Moderators are not employees or representatives of HWZ Forums. Forum members and moderators are responsible for their own posts. Please refer to our Community Guidelines and Standards and Terms and Conditions for more information.
Top