본문 바로가기
728x90
반응형

프로그래밍/Python6

python simple reflector server 가끔 점검할 때 필요해서 저장. from http.server import HTTPServer, BaseHTTPRequestHandler import json class MyHTTPRequestHandler( BaseHTTPRequestHandler ): def do_GET(self): self.send_response(200) self.send_header( 'Content-type', 'application/json' ) self.end_headers() self.wfile.write(b"") def do_POST(self): self.send_response(200) self.send_header( 'Content-type', 'application/json' ) self.end_headers() .. 2023. 1. 5.
how to get pid print util.proc.pidof(p) 2019. 1. 30.
Python telnetlib 1234567import telnetlib tn = telnetlib.Telnet("127.0.0.1", port=5021) print tn.read_until('\n') tn.write("flag");cs 라이트업 보다가 편해보여서 따옴. 좋은 라이브러리다. 2017. 5. 10.
Python GetProcAddress 12345678910111213import sysfrom ctypes import *import ctypesdef usage(): print "\n Usage : %s [dll] [proc]" % sys.argv[0] sys.exit() target_dll = "kernel32.dll"target_function = "WinExec"dll = windll.LoadLibrary(target_dll)kernel32 = windll.LoadLibrary("kernel32.dll")function = kernel32.GetProcAddress(c_ulonglong(dll._handle), b"WinExec")print "[##] Find Address : %s(%s) : 0x%08x" % (target_dll,.. 2017. 2. 23.
Python Socket example 12345678910111213141516import socketHOST = 'test.kr'PORT = 8000 s=socket.socket(socket.AF_INET,socket.SOCK_STREAM)s.connect((HOST,PORT)) data = s.recv(1024)print data s.send("5000" + '\n')data = s.recv(1024)print data s.close()Colored by Color Scriptercs 12345678910111213141516171819202122232425262728import socket HOST = '127.0.0.1'PORT = 9999 server_socket = socket.socket(socket.AF_INET, socket.. 2016. 9. 17.
python Convert list to ascii 12345ans = ""m = s.model()for i in xrange(0, num): ans += unichr(long(str(m[l[i]])))print anscs 자꾸 헷갈리니까 저장. 2016. 7. 5.
728x90
반응형