Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sqlmapproject
GitHub Repository: sqlmapproject/sqlmap
Path: blob/master/extra/shutils/pypi.sh
2992 views
1
#!/bin/bash
2
3
if [ ! -f ~/.pypirc ]; then
4
echo "File ~/.pypirc is missing"
5
exit 1
6
fi
7
8
declare -x SCRIPTPATH="${0}"
9
SETTINGS="${SCRIPTPATH%/*}/../../lib/core/settings.py"
10
VERSION=$(cat $SETTINGS | grep -E "^VERSION =" | cut -d '"' -f 2 | cut -d '.' -f 1-3)
11
TYPE=pip
12
TMP_DIR=/tmp/pypi
13
mkdir $TMP_DIR
14
cd $TMP_DIR
15
cat > $TMP_DIR/setup.py << EOF
16
#!/usr/bin/env python
17
18
"""
19
Copyright (c) 2006-2025 sqlmap developers (https://sqlmap.org)
20
See the file 'LICENSE' for copying permission
21
"""
22
23
from setuptools import setup, find_packages
24
25
setup(
26
name='sqlmap',
27
version='$VERSION',
28
description='Automatic SQL injection and database takeover tool',
29
long_description=open('README.rst').read(),
30
long_description_content_type='text/x-rst',
31
author='Bernardo Damele Assumpcao Guimaraes, Miroslav Stampar',
32
author_email='[email protected], [email protected]',
33
url='https://sqlmap.org',
34
project_urls={
35
'Documentation': 'https://github.com/sqlmapproject/sqlmap/wiki',
36
'Source': 'https://github.com/sqlmapproject/sqlmap/',
37
'Tracker': 'https://github.com/sqlmapproject/sqlmap/issues',
38
},
39
download_url='https://github.com/sqlmapproject/sqlmap/archive/$VERSION.zip',
40
license='GNU General Public License v2 (GPLv2)',
41
packages=['sqlmap'],
42
package_dir={'sqlmap':'sqlmap'},
43
include_package_data=True,
44
zip_safe=False,
45
# https://pypi.python.org/pypi?%3Aaction=list_classifiers
46
classifiers=[
47
'Development Status :: 5 - Production/Stable',
48
'License :: OSI Approved :: GNU General Public License v2 (GPLv2)',
49
'Natural Language :: English',
50
'Operating System :: OS Independent',
51
'Programming Language :: Python',
52
'Environment :: Console',
53
'Topic :: Database',
54
'Topic :: Security',
55
],
56
entry_points={
57
'console_scripts': [
58
'sqlmap = sqlmap.sqlmap:main',
59
],
60
},
61
)
62
EOF
63
wget "https://github.com/sqlmapproject/sqlmap/archive/$VERSION.zip" -O sqlmap.zip
64
unzip sqlmap.zip
65
rm sqlmap.zip
66
mv "sqlmap-$VERSION" sqlmap
67
cat > sqlmap/__init__.py << EOF
68
#!/usr/bin/env python
69
70
"""
71
Copyright (c) 2006-2025 sqlmap developers (https://sqlmap.org)
72
See the file 'LICENSE' for copying permission
73
"""
74
75
import os
76
import sys
77
78
sys.dont_write_bytecode = True
79
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
80
EOF
81
cat > README.rst << "EOF"
82
sqlmap
83
======
84
85
|Python 2.6|2.7|3.x| |License| |X|
86
87
sqlmap is an open source penetration testing tool that automates the
88
process of detecting and exploiting SQL injection flaws and taking over
89
of database servers. It comes with a powerful detection engine, many
90
niche features for the ultimate penetration tester and a broad range of
91
switches lasting from database fingerprinting, over data fetching from
92
the database, to accessing the underlying file system and executing
93
commands on the operating system via out-of-band connections.
94
95
Screenshots
96
-----------
97
98
.. figure:: https://raw.github.com/wiki/sqlmapproject/sqlmap/images/sqlmap_screenshot.png
99
:alt: Screenshot
100
101
102
You can visit the `collection of
103
screenshots <https://github.com/sqlmapproject/sqlmap/wiki/Screenshots>`__
104
demonstrating some of features on the wiki.
105
106
Installation
107
------------
108
109
You can use pip to install and/or upgrade the sqlmap to latest (monthly) tagged version with: ::
110
111
pip install --upgrade sqlmap
112
113
Alternatively, you can download the latest tarball by clicking
114
`here <https://github.com/sqlmapproject/sqlmap/tarball/master>`__ or
115
latest zipball by clicking
116
`here <https://github.com/sqlmapproject/sqlmap/zipball/master>`__.
117
118
If you prefer fetching daily updates, you can download sqlmap by cloning the
119
`Git <https://github.com/sqlmapproject/sqlmap>`__ repository:
120
121
::
122
123
git clone --depth 1 https://github.com/sqlmapproject/sqlmap.git sqlmap-dev
124
125
sqlmap works out of the box with
126
`Python <http://www.python.org/download/>`__ version **2.6**, **2.7** and
127
**3.x** on any platform.
128
129
Usage
130
-----
131
132
To get a list of basic options and switches use:
133
134
::
135
136
sqlmap -h
137
138
To get a list of all options and switches use:
139
140
::
141
142
sqlmap -hh
143
144
You can find a sample run `here <https://asciinema.org/a/46601>`__. To
145
get an overview of sqlmap capabilities, list of supported features and
146
description of all options and switches, along with examples, you are
147
advised to consult the `user's
148
manual <https://github.com/sqlmapproject/sqlmap/wiki/Usage>`__.
149
150
Links
151
-----
152
153
- Homepage: https://sqlmap.org
154
- Download:
155
`.tar.gz <https://github.com/sqlmapproject/sqlmap/tarball/master>`__
156
or `.zip <https://github.com/sqlmapproject/sqlmap/zipball/master>`__
157
- Commits RSS feed:
158
https://github.com/sqlmapproject/sqlmap/commits/master.atom
159
- Issue tracker: https://github.com/sqlmapproject/sqlmap/issues
160
- User's manual: https://github.com/sqlmapproject/sqlmap/wiki
161
- Frequently Asked Questions (FAQ):
162
https://github.com/sqlmapproject/sqlmap/wiki/FAQ
163
- X: https://x.com/sqlmap
164
- Demos: http://www.youtube.com/user/inquisb/videos
165
- Screenshots: https://github.com/sqlmapproject/sqlmap/wiki/Screenshots
166
167
.. |Python 2.6|2.7|3.x| image:: https://img.shields.io/badge/python-2.6|2.7|3.x-yellow.svg
168
:target: https://www.python.org/
169
.. |License| image:: https://img.shields.io/badge/license-GPLv2-red.svg
170
:target: https://raw.githubusercontent.com/sqlmapproject/sqlmap/master/LICENSE
171
.. |X| image:: https://img.shields.io/badge/[email protected]
172
:target: https://x.com/sqlmap
173
174
.. pandoc --from=markdown --to=rst --output=README.rst sqlmap/README.md
175
.. http://rst.ninjs.org/
176
EOF
177
sed -i "s/^VERSION =.*/VERSION = \"$VERSION\"/g" sqlmap/lib/core/settings.py
178
sed -i "s/^TYPE =.*/TYPE = \"$TYPE\"/g" sqlmap/lib/core/settings.py
179
for file in $(find sqlmap -type f | grep -v -E "\.(git|yml)"); do echo include $file >> MANIFEST.in; done
180
python setup.py sdist bdist_wheel
181
twine check dist/*
182
twine upload --config-file=~/.pypirc dist/*
183
rm -rf $TMP_DIR
184
185