python
文章平均质量分 57
Nixawk
这个作者很懒,什么都没留下…
展开
-
Python - rpcinfo
In order to scan all rpc hosts in lannet and save it into the databse, we need to create a script. $ rpcinfo -p 10.94.106.24 program vers proto port 100000 4 tcp 111 rpcbind 100原创 2017-03-15 13:30:03 · 1220 阅读 · 0 评论 -
Python - pwntools
pwntools is the CTF framework used by Gallopsled in every CTF.pwnlib.asmpwnlib.atexceptionpwnlib.atexitpwnlib.constantspwnlib.contextpwnlib.dynelfpwnlib.elfpwnlib.exceptionpwnlib.fmtstrpwnlib.原创 2015-05-18 01:36:24 · 2186 阅读 · 0 评论 -
Python - screenshot with PIL
Platform Windows 7 x86Prepare Download python package management tool, and install PIL with pip.wget.exe https://bootstrap.pypa.io/get-pip.pyC:\Python27\python.exe get-pip.pyInstall VCForPython27,原创 2015-05-14 12:15:13 · 1496 阅读 · 0 评论 -
python - thread/threading
Python thread/threading modules执行多个线程,类似于执行同时执行几个不同的程序,但是它有下面优势:一个进程内的多个线程,可以与主线程分享同一份数据,这样可以让它们之间交流更容易。线程有时候被称为轻量级进程,它们不需要额外的申请内存; 他们比进程消耗小。线程都有一个开始,执行序列,和一个结尾。它还有一个指令指针,跟踪当原创 2014-08-09 16:59:21 · 985 阅读 · 0 评论 -
Metasploit - Tips for Evading Anti-Virus
绕过杀毒软件,有许多钟方法。此处介绍一种,编写python程序调用shellcode,并使用Pyinstaler将python程序编译为exe程序。原创 2014-08-28 01:12:25 · 2369 阅读 · 0 评论 -
Python - cookielib [urllib2/requests]
cookie操作(读取,添加,删除,保存),结合urllib2和requests进行说明,此处只做局部演示,如果有疑问,请查阅: (Author: nixawk)https://docs.python.org/2/library/cookielib.htmlhttps://hg.python.org/cpython/file/2.7/Lib/cookielib.py原创 2015-01-23 17:10:41 · 1561 阅读 · 0 评论 -
Python - abc (Abstract Base Classes)
为何使用抽象基础类?抽象基础类,是一个接口,用于检测特定的方法。它比hasattr()方法更严格。定义一个基础类,你可以为子类定义一系列API。该方法很有用,尤其遇到一些第三方实现时,例如应用程序插件,同样可以避免为大工程的每个模块去实现一大片代码。ABCs如何工作abc 会将基类的方法作为一个抽象的对象,然后注册基本原创 2015-01-21 17:01:22 · 2808 阅读 · 0 评论 -
scrapy - tutorial
Install------------------------------------------------------------------sudo pip install libxml2-dev libxslt1-dev lxml libffi-devgit clone git://github.com/scrapy/scrapy.gitcd /path/to/scrapy/sudo python setup.py install原创 2014-05-08 13:04:05 · 1268 阅读 · 0 评论 -
Python - reload(sys) + sys.setdefaultencoding
看代码时, 发现sys.setdefaultencoding前面有一行reload(sys),不理解是什么作用。研究了一下, 发现下面的内容:[notfound@core ~]$ pythonPython 2.7.9 (default, Dec 11 2014, 04:42:00) [GCC 4.9.2] on linux2Type "help", "c原创 2015-01-15 14:09:02 · 3866 阅读 · 0 评论 -
python - pickle
pickle模块实现了一个基础而强劲的算法, 用于序列化和反序列化Python对象结构.'Pickling' ---- 指将Python对象转换为字节流的过程.'unpickling' ---- 指将字节流转回为Python对象.Pickling (和 unpickling),有时也被称为"序列化", "编组", "扁平化".为了避免混淆, Python团队决定原创 2015-01-27 20:00:41 · 881 阅读 · 0 评论 -
Python --- subprocess
subprocess.call(args,*,stdin=None, stdout=None,stderr=None, shell=False)subprocess.check_call(args,*,stdin=None, stdout=None,stderr=None, shell=False)subprocess.check_output(ar原创 2014-11-22 14:10:18 · 979 阅读 · 0 评论 -
python - struct
浅析Python中的struct模块 最近在学习python网络编程这一块,在写简单的socket通信代码时,遇到了struct这个模块的使用,当时不太清楚这到底有和作用,后来查阅了相关资料大概了解了,在这里做一下简单的总结。 了解c语言的人,一定会知道struct结构体在c语言中的作用,它定义了一种结构,里面包含不同类型的数据(int,char,bool等等),方便对某一原创 2014-04-13 11:33:53 · 734 阅读 · 0 评论 -
python - 分析openssl-CVE-2014-0160
完整openssl-CVE-2014-0160c代码如下:#!/usr/bin/python# Connects to servers vulnerable to CVE-2014-0160 and looks for cookies, specifically user sessions.# Michael Davis ([email protected])原创 2014-04-17 17:49:58 · 1028 阅读 · 0 评论 -
python - scapy - arpscanner
How to get a internal target mac address: 1. Send a ARP request 2. Recv a ARP response, and parse it.With scapy (a powerful packet tool or library), we can create a arp scanner for mac addres原创 2015-05-23 00:32:24 · 1522 阅读 · 0 评论 -
python - scapy - dns sniffer / posioning
How to parse dns request and response ? Scapy is a powerful tool, and it can help us for dns detail.#!/usr/bin/env python# -*- coding: utf8 -*-"""execte demo py with root privilege, and finish double原创 2015-05-23 11:38:09 · 5105 阅读 · 0 评论 -
python - scapy - fuzz
Start a tcp sniffer, and monitor tcp response. We can find surprise at sometimes.>>> sniff(prn=lambda x:x.show(), filter="(tcp port 80) and (ip dst 192.168.1.107 or ip src 192.168.1.107)")###[ Etherne原创 2015-05-24 12:19:37 · 1753 阅读 · 0 评论 -
Python - decode ip header
#!/usr/bin/python# -*- coding: utf-8 -*-from ctypes import *import socketimport structclass IP(Structure): _fields_ = [ ("ihl", c_uint8, 4), ("version", c_uint8, 4), ("to原创 2017-03-30 11:51:07 · 1592 阅读 · 0 评论 -
Python - NTP
In order to learn ntp protocol and protect ntp server against NTP DDOS Attack. We need a vulnable ntp server.Install a vulnerable NTP Server - NTP 4.2.6#!/bin/bashwget -c https://www.eecis.udel.edu/~nt原创 2017-03-28 12:41:50 · 1563 阅读 · 0 评论 -
python - weixin bot
If you are a newbee, please just run it. If you are a developer. please use it as a module.python>>> import webwxbot>>> dir(webwxbot)>>> wx = webwxbot.WEIXINBOT()>>> dir(wx)['__class__', '__delatt原创 2017-03-02 19:20:57 · 1043 阅读 · 0 评论 -
Python - rq / mrq / Celery
rqSimple job queues for Python http://python-rq.orgPlease read the results from redis server.mrqMr. Queue - A distributed worker task queue in Python using Redis & gevent - https://github.com/pricingas原创 2016-10-26 14:01:17 · 1830 阅读 · 0 评论 -
Python - WIFI Scan
How to find weak wireless APs with SSID:BSSID ? #!/usr/bin/python# -*- coding: utf8 -*-from access_points import get_scannerdef parse_apinfo(ap): return (ap['quality'], ap['ssid'], ap['bssid'])d原创 2016-10-09 10:27:42 · 4371 阅读 · 1 评论 -
virtualenv and virtualenvwrapper
Ian Bicking’s virtualenv tool has become the de-facto standard mechanism for isolating Python environments. Its purpose is simple: if you have a number of Python projects on a single machine, each with转载 2016-06-20 14:27:28 · 484 阅读 · 0 评论 -
linux - python shell auto completion
# save file to ~/.pystartup# export PYTHONSTARTUP=~/.pystartup# Enable OSX Tab Completion# http://stackoverflow.com/questions/7116038/python-tab-completion-mac-osx-10-7-lion# http://stackoverflow.co原创 2016-06-16 10:51:15 · 678 阅读 · 0 评论 -
vim - Run python code in vim editor
Create demo file /tmp/demo.txt, AAAAAAAAAAAABBBBBBBBBBBBabc = "/Hello World/"print(abc)Operations:In visual mode, select text area. Please use key V, j.Input commands: :!python原创 2015-10-23 10:48:14 · 708 阅读 · 0 评论 -
Python -- Make vim as a python IDE
root@gnu:~# git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vimInitialized empty Git repository in /root/.vim/bundle/Vundle.vim/.git/root@gnu:~# vim ~/.vimrc root@gnu:~# vi原创 2014-05-05 21:26:24 · 2229 阅读 · 0 评论 -
python - bing_api_search
#!/usr/bin/python# -*- coding: utf-8 -*-# Author: Nixawk# Name: bing api search# Date: Sat Sep 26 11:39:32 UTC 2015# Docs: https://datamarket.azure.com/dataset/bing/searchimport requestsimpo原创 2015-09-26 21:34:21 · 904 阅读 · 0 评论 -
python - socket / setblocking
In network programming, it is common to hear about different kinds of I/O programming models such as blocking I/O, nonblocking I/O, and polling. The purpose of this exercise is to simply define what these terms mean with some simple socket examples.(a) B原创 2014-04-16 17:18:03 · 6566 阅读 · 0 评论 -
scapy rdpcap
_ _ _ ____ _ _ | | | | __ _ ___| | __ | __ ) __ _ ___| | _| | | |_| |/ _` |/ __| |/ / | _ \ / _` |/ __| |/ / | |原创 2014-08-13 12:23:12 · 8879 阅读 · 0 评论 -
scapy document
Navigationindexnext |previous |Scapy v2.1.1-dev documentation » Usage¶Starting Scapy¶Scapy’s interactive shell is run in a terminal session. Root privileges are needed to原创 2014-08-12 23:15:49 · 3634 阅读 · 0 评论 -
python -- 获取 bing 查询结果
#!/usr/bin/env pythonimport timeimport urllib2from lxml import etreefrom urllib import urlencodefrom optparse import OptionParserclass search(object): def __init__(self): self.re原创 2014-05-26 14:26:44 · 4505 阅读 · 0 评论 -
Python -- yield
http: //www.ibm.com/developerworks/cn/opensource/os-cn-python-yield/-------------------------------------------------------------------------------------------------------您可能听说过,带有 yield 的函数在 Py原创 2014-05-14 13:10:50 · 682 阅读 · 0 评论 -
python -- list 性能测试
List 在使用过程中h原创 2014-05-14 14:03:51 · 659 阅读 · 0 评论 -
python -- property()/@property
https://docs.python.org/2/library/functions.html?highlight=property#property原创 2014-05-14 09:23:28 · 789 阅读 · 0 评论 -
python -- type/isinstance
http://stackoverflow.com/questions/1549801/differences-between-isinstance-and-type-in-python转载 2014-05-13 10:27:19 · 579 阅读 · 0 评论 -
python -- getattr
https://docs.python.org/2/library/functions.html?highlight=getattr#getattr原创 2014-05-13 19:39:13 · 729 阅读 · 0 评论 -
python -- ConfigParser
开始xue[db]db_host = 127.0.0.1db_port = 22db_user = rootdb_pass = password[misc]timeout = 8thread = 10原创 2014-05-19 17:12:01 · 781 阅读 · 0 评论 -
python -- 字符十六进制列表
有时候需要yong原创 2014-05-19 11:19:07 · 2730 阅读 · 0 评论 -
python - 文件枚举
有时候做测试,需要生成文件列表,今天写个原创 2014-05-17 23:08:45 · 846 阅读 · 0 评论 -
python - super
http://stackoverflow.com/questions/9698614/super-raises-typeerror-must-be-type-not-classobj-for-new-style-class-----------------------------------------------------------------------#!/usr/bin/e原创 2014-05-17 19:18:48 · 711 阅读 · 0 评论 -
python -- 密码生成器
代码可能写的特别粗糙, 请自行优化.#!/usr/bin/env pythonimport itertoolsimport stringimport sysdef usage(): print "Password generator - v1.0 " print "\t%s [type] [length]" % sys.argv[0] print "\原创 2014-05-16 18:07:57 · 947 阅读 · 0 评论