Category: Python

Backdoors, Git, Github, Python

Github APIv3 python wrapper

pygithub3 is a Github APIv3 python wrapper. Search in commits message from pygithub3 import Github   gh = Github(token=access_token, user=username, repo=myrepo) commits=[] commits = gh.repos.commits.list().all() for c in commits: if ‘blahblah’ == c.commit.message: passfrom pygithub3 import Github gh = Github(token=access_token, user=username, repo=myrepo) commits=[] commits = gh.repos.commits.list().all() for c in commits: if ‘blahblah’ == c.commit.message: pass …

Debian, Django, Python

Apache2 and Django installation on Debian

Install Apache2 sudo apt-get install apache2 -y sudo rm -f /var/www/html/index.html && sudo touch /var/www/html/index.html sudo a2enmod ssl sudo a2ensite default-ssl sudo service apache2 restartsudo apt-get install apache2 -y sudo rm -f /var/www/html/index.html && sudo touch /var/www/html/index.html sudo a2enmod ssl sudo a2ensite default-ssl sudo service apache2 restart Install Python 3 sudo apt-get install python3 -y …

Burp, Python

Simple python script to make multiple raw requests from Burp

* Open your Burp. * Copy requests from Repeater. * Store them in txt files. One request per file. * Edit/Set auth cookies inside script. * Run python call_burp_requests.pypython call_burp_requests.py Download https://gist.github.com/maldevel/a19cc1a959023f40518c48a95448c3b9 import requests import os   proxies = { ‘http’: ‘http://127.0.0.1:8080’, ‘https’: ‘http://127.0.0.1:8080’, }   protocol = ‘https’ xsrf = ‘xsrf-token’ auth_cookie = ‘sessionid=blah-blah-blah’ …

Python

A powerful DNS toolkit for python

nslookup is a network administration command-line tool available for many computer operating systems for querying the Domain Name System (DNS) to obtain domain name or IP address mapping or for any other specific DNS record. – Wikipedia DNS record types A,AAAA,AFSDB,APL,CAA,CDNSKEY,CDS,CERT,CNAME,DHCID,DLV, DNAME,DNSKEY,DS,HIP,IPSECKEY,KEY,KX,LOC,MX,NAPTR,NS, NSEC,NSEC3,NSEC3PARAM,PTR,RRSIG,RP,SIG,SOA,SRB,SSHFP, TA,TKEY,TLSA,TSIG,TXT,*,AXFR,IXFR,OPT – Wikipedia dnspython is a DNS toolkit for Python. It supports …

Hacking, Python

Manipulate Network Packets

Impacket is a collection of Python classes for working with network protocols. Impacket is focused on providing low-level programmatic access to the packets and for some protocols (for instance NMB, SMB1-3 and MS-DCERPC) the protocol implementation itself. Packets can be constructed from scratch, as well as parsed from raw data, and the object oriented API …

Python

How to install PyCrypto on Windows

Python Cryptography Toolkit (pycrypto) is a collection of both secure hash functions (such as SHA256 and RIPEMD160), and various encryption algorithms (AES, DES, RSA, ElGamal, etc.). The package is structured to make adding new modules easy. > Download Microsoft Visual C++ Compiler for Python 2.7 > Run command prompt as adminsitrator > Execute: msiexec /i …

Programming, Python

Install python3 packages with pip

Assuming that you have python2 also installed on the system. >> Install virtualenv sudo apt-get install virtualenvsudo apt-get install virtualenv >> Create shortcut virtualenv -p /usr/bin/python3 py3virtualenv -p /usr/bin/python3 py3 >> Activate shortcut source py3/bin/activatesource py3/bin/activate >> Install package pip install packagepip install package

Network, Python

Make whois queries

PyWhois is a python module for retrieving WHOIS information of domains. Script: #!/usr/bin/python   import sys, whois from optparse import OptionParser   def main(): try: parser = OptionParser() parser.add_option("-d", "–domain", dest="domain", help="domain to query") (options, args) = parser.parse_args()   if options.domain==None: parser.print_help() sys.exit(0)   print ‘looking for ‘ + options.domain + ‘..n’ w = whois.whois(options.domain) …