client9 / libinjection

SQL / SQLI tokenizer parser analyzer
Other
998 stars 274 forks source link

Python 3 binding #108

Open afeena opened 8 years ago

afeena commented 8 years ago

Has anybody used libinjection with python 3.5? I didn't find any info about python 3 support. I built libinjection python version with -py3 swig option and got the module:

# pip3 show libinjection                
---                                                                                          
Metadata-Version: 1.1                                                                        
Name: libinjection                                                                           
Version: 3.9.1                                                                               
Summary: Wrapper around libinjection c-code to detect sqli                                   
Home-page: https://libinjection.client9.com/                                                 
Author: Nick Galbreath                                                                       
Author-email: nickg@client9.com                                                              
License: UNKNOWN                                                                             
Location: /usr/local/lib/python3.5/dist-packages/libinjection-3.9.1-py3.5-linux-x86_64.egg   
Requires:                                                                                    
Classifiers:                                                                                 
  Intended Audience :: Developers                                                            
  License :: OSI Approved :: BSD License                                                     
  Topic :: Database                                                                          
  Topic :: Security                                                                          
  Operating System :: OS Independent                                                         
  Development Status :: 3 - Alpha                                                            
  Topic :: Internet :: Log Analysis                                                          
  Topic :: Internet :: WWW/HTTP                                                              

I can import the module without errors, but I can't use libinjection functions (from the docs):

Python 3.5.1+ (default, Mar 30 2016, 22:46:26)
[GCC 5.3.1 20160330] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from libinjection import *
>>> sqli_state()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'sqli_state' is not defined

The same code works well on python 2.7

Python 2.7.11+ (default, Apr 17 2016, 14:00:29)
[GCC 5.3.1 20160413] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from libinjection import *
>>> sqli_state()
<Swig Object of type 'libinjection_sqli_state *' at 0x7f1827952f48>

It will be really great if somebody can help me with this question. Thanks!

client9 commented 8 years ago

sorry, I don't really know what do here. I hope someone else can help with the python swig bindings!

oxr463 commented 4 years ago

@client9 does this support Python 3 yet?

zimmerle commented 4 years ago

@oxr463 working on it at: libinjection/libinjection#4