Skip to content

Instantly share code, notes, and snippets.

View xros's full-sized avatar
🎯
Focusing

Songhua Liu xros

🎯
Focusing
View GitHub Profile
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="schwiz.net.weartest" >
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
@xros
xros / git-flow.md
Last active August 29, 2015 14:26 — forked from yesmeck/git-flow.md
Git 开发流程

Git 协作流程

master 分支

master 永远处于稳定状态,这个分支代码可以随时用来部署。不允许在该分支直接提交代码。

develop 分支

开发分支,包含了项目最新的功能和代码,所有开发都在 develop 上进行。一般情况下小的修改直接在这个分支上提交代码。

@xros
xros / jail.local
Last active October 24, 2020 07:04 — forked from Swop/jail.local
Adds Nginx DOS detection to Fail2ban
# /etc/fail2ban/jail.local
# [...]
[nginx-dos]
# Based on apache-badbots but a simple IP check (any IP requesting more than
# 240 pages in 60 seconds, or 4p/s average, is suspicious)
# Block for two full days.
# @author xros
enabled = true
@xros
xros / sqlalchemy_example.py
Created March 25, 2016 08:51 — forked from podhmo/sqlalchemy_example.py
sqlalchemy query example.
import sqlalchemy as sa
import sqlalchemy.orm as orm
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.ext.declarative import declared_attr
from sqlalchemy.orm import scoped_session, sessionmaker
DBSession = scoped_session(sessionmaker())
class BaseMixin(object):
query = DBSession.query_property()
id = sa.Column(sa.Integer, primary_key=True)
@xros
xros / docker-compose.yml
Created April 4, 2016 05:05 — forked from cboettig/docker-compose.yml
debugging NGINX configuration for Jupyter
jupyter:
image: jupyter/datascience-notebook
environment:
- PASSWORD=${PASSWORD}
nginx:
image: nginx
links:
- jupyter
@xros
xros / django-template-filters.py
Created April 12, 2016 05:40 — forked from mesuutt/django-template-filters.py
Useful django template tags and filters
# coding: utf-8
import json
from django import template
from django.utils.dateparse import parse_datetime
from django.utils.html import mark_safe
register = template.Library()
@xros
xros / intercept-https-with-python-mitmproxy.md
Created June 13, 2016 13:36 — forked from dannvix/intercept-https-with-python-mitmproxy.md
Intercept and manipulate HTTPs traffic with Python and mitmproxy

Intercepts HTTPs Traffic with Python & mitmproxy

Warning

This Gist is created in 2014, and it's highliy outdated now, according to one of mitmproxy's manjor contributor (check his comment below). Thanks for letting us know, @mhils!

Introduction

Modern applications usually make use of back-end API servers to provide their services. With a non-transparent HTTPs proxy, which intercepts the communication between clients and servers (aka the man-in-the-middle scheme), you can easily manipulate both API requests and responses.

@xros
xros / crEAP.py
Created July 1, 2016 20:57 — forked from interference-security/crEAP.py
crEAP is a utility which will identify WPA Enterprise Mode Encryption types and if #insecure protocols are in use, crEAP will harvest Radius usernames and handshakes. (https://github.com/Shellntel/scripts/blob/master/crEAP.py)
#!/usr/bin/python
#crEAP is a utility which will identify WPA Enterprise Mode Encryption types and if
#insecure protocols are in use, crEAP will harvest Radius usernames and handshakes.
#Author: Snizz
#Requirements: Should be run as root/sudo.
#
# Python Scapy Community (scapy-com) - Dev version of Scapy which supports additional
@xros
xros / ssid-sniffer-scapy-python.py
Created July 1, 2016 20:57 — forked from securitytube/ssid-sniffer-scapy-python.py
WLAN SSID Sniffer in Python using Scapy
#!/usr/bin/env python
from scapy.all import *
ap_list = []
def PacketHandler(pkt) :
if pkt.haslayer(Dot11) :
if pkt.type == 0 and pkt.subtype == 8 :
# Reset our signal handler
signal.signal(signal.SIGINT, signal.SIG_DFL)
target_bssid = raw_input('Enter a BSSID to perform an deauth attack (q to quit): ')
while target_bssid not in networks:
if target_bssid == 'q' : sys.exit(0)
raw_input('BSSID not detected... Please enter another (q to quit): ')
# Get our interface to the correct channel
print 'Changing ' + args.interface + ' to channel ' + str(networks[target_bssid][1])
os.system("iwconfig %s channel %d" % (args.interface, networks[target_bssid][1]))
# Now we have a bssid that we have detected, let's get the client MAC