sqlmap/extra/shutils/pypi.sh

181 lines
5.7 KiB
Bash
Raw Normal View History

2016-08-02 14:21:05 +03:00
#!/bin/bash
2017-08-04 14:59:15 +03:00
if [ ! -f ~/.pypirc ]; then
echo "File ~/.pypirc is missing"
exit 1
fi
2016-08-02 14:21:05 +03:00
declare -x SCRIPTPATH="${0}"
SETTINGS="${SCRIPTPATH%/*}/../../lib/core/settings.py"
VERSION=$(cat $SETTINGS | grep -E "^VERSION =" | cut -d '"' -f 2 | cut -d '.' -f 1-3)
TYPE=pip
TMP_DIR=/tmp/pypi
mkdir $TMP_DIR
cd $TMP_DIR
cat > $TMP_DIR/setup.py << EOF
#!/usr/bin/env python
"""
2023-01-03 01:24:59 +03:00
Copyright (c) 2006-2023 sqlmap developers (https://sqlmap.org/)
2017-10-11 15:50:46 +03:00
See the file 'LICENSE' for copying permission
2016-08-02 14:21:05 +03:00
"""
from setuptools import setup, find_packages
setup(
name='sqlmap',
version='$VERSION',
description='Automatic SQL injection and database takeover tool',
long_description=open('README.rst').read(),
long_description_content_type='text/x-rst',
2016-08-02 14:21:05 +03:00
author='Bernardo Damele Assumpcao Guimaraes, Miroslav Stampar',
author_email='bernardo@sqlmap.org, miroslav@sqlmap.org',
2021-09-08 22:01:41 +03:00
url='https://sqlmap.org',
2019-01-06 02:29:31 +03:00
project_urls={
'Documentation': 'https://github.com/sqlmapproject/sqlmap/wiki',
'Source': 'https://github.com/sqlmapproject/sqlmap/',
'Tracker': 'https://github.com/sqlmapproject/sqlmap/issues',
},
2016-08-02 14:21:05 +03:00
download_url='https://github.com/sqlmapproject/sqlmap/archive/$VERSION.zip',
license='GNU General Public License v2 (GPLv2)',
packages=find_packages(),
include_package_data=True,
zip_safe=False,
# https://pypi.python.org/pypi?%3Aaction=list_classifiers
classifiers=[
'Development Status :: 5 - Production/Stable',
'License :: OSI Approved :: GNU General Public License v2 (GPLv2)',
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Environment :: Console',
'Topic :: Database',
'Topic :: Security',
],
entry_points={
'console_scripts': [
'sqlmap = sqlmap.sqlmap:main',
],
},
)
EOF
wget "https://github.com/sqlmapproject/sqlmap/archive/$VERSION.zip" -O sqlmap.zip
unzip sqlmap.zip
rm sqlmap.zip
mv "sqlmap-$VERSION" sqlmap
cat > sqlmap/__init__.py << EOF
#!/usr/bin/env python
"""
2023-01-03 01:24:59 +03:00
Copyright (c) 2006-2023 sqlmap developers (https://sqlmap.org/)
2017-10-11 15:50:46 +03:00
See the file 'LICENSE' for copying permission
2016-08-02 14:21:05 +03:00
"""
import os
import sys
sys.dont_write_bytecode = True
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
EOF
cat > README.rst << "EOF"
sqlmap
======
2022-02-11 00:41:44 +03:00
|Python 2.6|2.7|3.x| |License| |Twitter|
2016-08-02 14:21:05 +03:00
sqlmap is an open source penetration testing tool that automates the
process of detecting and exploiting SQL injection flaws and taking over
of database servers. It comes with a powerful detection engine, many
niche features for the ultimate penetration tester and a broad range of
switches lasting from database fingerprinting, over data fetching from
the database, to accessing the underlying file system and executing
commands on the operating system via out-of-band connections.
Screenshots
-----------
.. figure:: https://raw.github.com/wiki/sqlmapproject/sqlmap/images/sqlmap_screenshot.png
:alt: Screenshot
You can visit the `collection of
screenshots <https://github.com/sqlmapproject/sqlmap/wiki/Screenshots>`__
demonstrating some of features on the wiki.
Installation
------------
You can use pip to install and/or upgrade the sqlmap to latest (monthly) tagged version with: ::
pip install --upgrade sqlmap
Alternatively, you can download the latest tarball by clicking
`here <https://github.com/sqlmapproject/sqlmap/tarball/master>`__ or
latest zipball by clicking
`here <https://github.com/sqlmapproject/sqlmap/zipball/master>`__.
If you prefer fetching daily updates, you can download sqlmap by cloning the
`Git <https://github.com/sqlmapproject/sqlmap>`__ repository:
::
2017-01-02 16:31:19 +03:00
git clone --depth 1 https://github.com/sqlmapproject/sqlmap.git sqlmap-dev
2016-08-02 14:21:05 +03:00
sqlmap works out of the box with
2019-05-08 14:38:07 +03:00
`Python <http://www.python.org/download/>`__ version **2.6**, **2.7** and
**3.x** on any platform.
2016-08-02 14:21:05 +03:00
Usage
-----
To get a list of basic options and switches use:
::
2020-01-24 00:18:53 +03:00
sqlmap -h
2016-08-02 14:21:05 +03:00
To get a list of all options and switches use:
::
2020-01-24 00:18:53 +03:00
sqlmap -hh
2016-08-02 14:21:05 +03:00
You can find a sample run `here <https://asciinema.org/a/46601>`__. To
get an overview of sqlmap capabilities, list of supported features and
description of all options and switches, along with examples, you are
advised to consult the `user's
2017-04-13 13:47:14 +03:00
manual <https://github.com/sqlmapproject/sqlmap/wiki/Usage>`__.
2016-08-02 14:21:05 +03:00
Links
-----
2021-09-08 22:01:41 +03:00
- Homepage: https://sqlmap.org
2016-08-02 14:21:05 +03:00
- Download:
`.tar.gz <https://github.com/sqlmapproject/sqlmap/tarball/master>`__
or `.zip <https://github.com/sqlmapproject/sqlmap/zipball/master>`__
- Commits RSS feed:
https://github.com/sqlmapproject/sqlmap/commits/master.atom
- Issue tracker: https://github.com/sqlmapproject/sqlmap/issues
- User's manual: https://github.com/sqlmapproject/sqlmap/wiki
- Frequently Asked Questions (FAQ):
https://github.com/sqlmapproject/sqlmap/wiki/FAQ
2019-03-12 14:26:38 +03:00
- Twitter: https://twitter.com/sqlmap
2016-08-02 14:21:05 +03:00
- Demos: http://www.youtube.com/user/inquisb/videos
- Screenshots: https://github.com/sqlmapproject/sqlmap/wiki/Screenshots
2019-05-08 14:38:07 +03:00
.. |Python 2.6|2.7|3.x| image:: https://img.shields.io/badge/python-2.6|2.7|3.x-yellow.svg
2016-08-02 14:21:05 +03:00
:target: https://www.python.org/
.. |License| image:: https://img.shields.io/badge/license-GPLv2-red.svg
2017-10-11 15:50:46 +03:00
:target: https://raw.githubusercontent.com/sqlmapproject/sqlmap/master/LICENSE
2016-08-02 14:21:05 +03:00
.. |Twitter| image:: https://img.shields.io/badge/twitter-@sqlmap-blue.svg
:target: https://twitter.com/sqlmap
.. pandoc --from=markdown --to=rst --output=README.rst sqlmap/README.md
.. http://rst.ninjs.org/
EOF
sed -i "s/^VERSION =.*/VERSION = \"$VERSION\"/g" sqlmap/lib/core/settings.py
sed -i "s/^TYPE =.*/TYPE = \"$TYPE\"/g" sqlmap/lib/core/settings.py
for file in $(find sqlmap -type f | grep -v -E "\.(git|yml)"); do echo include $file >> MANIFEST.in; done
python setup.py sdist upload
2019-01-06 02:29:31 +03:00
rm -rf $TMP_DIR