Skip to content

generic kannel smsbox proxy to intercept and manipulate traffic .

Notifications You must be signed in to change notification settings

AShabana/gproxy

Repository files navigation

Current version :
	write scenario i.e. linkX 
	add it to runtime folder
	add it to runtime/__init__.py without .py
	you can also add conf i.e. config/lists/all.py
	restart the proxy

INSTALLATION:
-----------
	Pre-Requirsits :
	-------------
		Twisted==14.0.2
		configobj==5.0.6
		six==1.8.0
		zope.interface==4.1.1

	Steps for first time startup:
	----------------------------
	1. Create startup config
	------------------------
		$ python
		>>> accounts = ( 'ahmed' ,'ali' ,'omar')
		>>> with open('accounts','wb') as fd :
		...     pickle.dump(accounts, fd)
		... 
		>>> with open('accounts','r') as fd :
		...     pickle.load(fd)
		... 
		('ahmed', 'ali', 'omar')
		
		# Create SHARED MEMORY SEG
		mkdir /dev/shm/gproxy/
		OR, run 
		$ cd testing_tools
		$ python create_fake_firsttime_startup.py
		
	2. Add config file as a startup i.e. config/app.conf
	----------------------------------------------------

		logic = "KannelProxy"
		lists = "config/lists/accounts"
		counter-path = "counters"
		ports = "2014,2015,2016,2017,2018"
		log-file = "/var/log/GProxy.log"
		pid-file = "listener.pid"

	3. Use it
	---------
	   a) Listener
		python listener.py -f config/app.conf # default just act as python listener.py
		or
		python listener.py -f config/test.conf
	   b) GPAdmin.py
	       python GPAdmin.py --help
	       before run webinterface
	       put www at /var/www/html
	       start apache
	       python GPAdmin.py
	       
	4. Add policy :
	--------------
	example 
	Add policy called ksa 
	1. add runtime/__init__.py
	<code>
	_all__=['Aroli','ksa']
	</code>
	2. add runtime/ksa.py file 
<code>	
from proxylib import Request
from twisted.python import log
from twisted.python.util import println
import imp

def exe(r):
# Header at automation
	request = Request.requestObject(r)

# End Header
	if request.sender not in Config["ksa_white_list_senders"] : #ALL KSA whitelist
		request.smsc = "ignore"
	elif request.sender not in Config["stc_white_list_senders"] : #STC whitelist
		request.smsc = "stc_adv"
	else :
		request.smsc = "stc" # Transaction route
	request.kannelIP = "ksa"
	request.send()
</code>

About

generic kannel smsbox proxy to intercept and manipulate traffic .

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published