Skip to content
KitploitKITPLOIT
उपकरणब्लॉग
जमा करें
उपकरणब्लॉग
जमा करें

हैकिंग, पेनटेस्ट और साइबर सुरक्षा उपकरण आपके सुरक्षा शस्त्रागार के लिए!

Kitploit हैकिंग, साइबर सुरक्षा और पेंटेस्टिंग टूल्स की एक निर्देशिका है। कमजोरियों को खोजने, सिस्टम का विश्लेषण करने, परीक्षण को स्वचालित करने और अपनी सुरक्षा को मजबूत करने के लिए नवीनतम प्रोजेक्ट अपडेट खोजें।

··फ़ीड·संपर्क·गोपनीयता·© 2026 Kitploit

टूल निर्देशिका

श्रेणियाँ

सभी श्रेणियाँ देखें
Loading categories
wafparan01d3 — Quick WAF "paranoid" Doctor Evaluation | WAFPARAN01D3 Tool | Kitploit
उपकरण/GitHubGitHub/alt3kx/wafparan01d3
Defensive ToolsScripting & AutomationConfiguration AuditingWeb SecurityPenetration Testing
GitHubalt3kx/wafparan01d3

wafparan01d3

Quick WAF "paranoid" Doctor Evaluation | WAFPARAN01D3 Tool

रिपॉजिटरी देखें
2464 साल पहलेKitploit द्वारा समीक्षित

सबसे लोकप्रिय

सभी देखें →

हमारे समुदाय द्वारा सबसे अधिक उपयोग किए जाने वाले उपकरण खोजें।

सभी उपकरण खोजें

हमारे उपकरणों का संग्रह ब्राउज़ करें

सभी उपकरण देखें →
साझा करें

त्वरित WAF "पैरानॉइड" डॉक्टर मूल्यांकन

wafparano1d3
WAFPARAN01D3

वेब एप्लिकेशन फ़ायरवॉल पैरानॉइड स्तर परीक्षण उपकरण।
— से alt3kx.github.io

पैरानॉइड स्तरों का परिचय

संक्षेप में, पैरानॉइड स्तर (PL) आपको यह परिभाषित करने की अनुमति देता है कि कोर रूल सेट कितना आक्रामक है।
संदर्भ: https://coreruleset.org/20211028/working-with-paranoia-levels/

यह कैसे काम करता है

  • wafparan01d3.py पायथन3 स्क्रिप्ट GET पैरामीटर के आधार पर HTTP अनुरोधों के विभिन्न भागों में रखे एन्कोडेड पेलोड का उपयोग करके दुर्भावनापूर्ण अनुरोध लेती है, मूल्यांकन के परिणाम आपकी मशीन पर बनाई गई रिपोर्ट डीबग फ़ाइल wafparan01d3.log में दर्ज किए जाते हैं।
  • डिफ़ॉल्ट कॉन्फ़िग स्तर का उपयोग करके प्रत्येक WAF पैरानॉइड स्तर के लिए अलग-अलग हमलों या पेलोड सेट करते हुए व्यवहार और प्रतिक्रिया का निरीक्षण करें।
  • नीचे दिया गया PoC शुरू से बुनियादी इंस्टॉलेशन और कॉन्फ़िगरेशन प्रदान करता है और एक बुनियादी "मॉक" सेट करके वर्तमान में तैनात WAF का पुनः उपयोग करता है तथा बैकएंड का अनुकरण करता है।
  • डिफ़ॉल्ट उपलब्ध पेलोड mysql_gosecure.txt कहलाता था, जो gosecure के शोध "A Scientific Notation Bug in MySQL left AWS WAF Clients Vulnerable to SQL Injection" पर आधारित है, जो यहाँ उपलब्ध है https://www.gosecure.net/blog/2021/10/19/a-scientific-notation-bug-in-mysql-left-aws-waf-clients-vulnerable-to-sql-injection/ जिसमें हम अपने WAF का modsecurity का उपयोग करके उनके विभिन्न पैरानॉइड स्तरों में मूल्यांकन करते हैं, या तो डिफ़ॉल्ट कॉन्फ़िगरेशन में या विभिन्न नियमों / IDs को चरणबद्ध और त्वरित तरीके से अक्षम करके।

दृष्टिकोण

  • पेंटेस्टर्स: WAF लिनक्स बॉक्स तक सीमित पहुंच के साथ ग्रेबॉक्स दायरा, DEV/STG/TEST वातावरणों में विभिन्न पेलोड भेजते हुए WAF Apache कॉन्फ़िग फ़ाइलों को शुरू/पुनः लोड और संपादित करने के विशेषाधिकार वाले "शेल" का उपयोग करना।
  • सुरक्षा अधिकारी: आपके संगठन में प्रत्येक समाधान के लिए WAF पैरानॉइड का स्तर लागू करने का सर्वोत्तम निर्णय लें।
  • ब्लूटीमर्स: नियम प्रवर्तन, सर्वोत्तम अलर्टिंग, आपके संगठन में कम गलत-सकारात्मक परिणाम।
  • इंटीग्रेटर्स: नियमों को त्वरित रूप से अनुकूलित करके या वर्चुअल पैच बनाकर गहन समस्या निवारण करें और WAF पैरानॉइड का उपयुक्त स्तर परिभाषित करें।

प्रूफ ऑफ कॉन्सेप्ट: Ubuntu 20.04.3 और OWASP कोर रूल सेट (CRS) v3.3.2 पर आधारित

संदर्भ: https://www.inmotionhosting.com/support/server/apache/install-modsecurity-apache-module/

प्रारंभिक इंस्टॉलेशन

  1. सॉफ़्टवेयर रिपॉजिटरी अपडेट करें:
root@kitploit:~
$ sudo apt update -y && sudo apt dist-upgrade -y
  1. आवश्यक पैकेज इंस्टॉल करें:
root@kitploit:~
$ sudo apt-get install build-essential -y
  1. ubuntu के लिए apache2 इंस्टॉल करें (यदि यह इंस्टॉल नहीं है):
root@kitploit:~
$ sudo apt-get install apache2 -y
  1. ModSecurity Apache मॉड्यूल डाउनलोड और इंस्टॉल करें:
root@kitploit:~
$ sudo apt install libapache2-mod-security2 -y
  1. ubuntu के लिए curl इंस्टॉल करें (यदि यह इंस्टॉल नहीं है):
root@kitploit:~
$ sudo apt-get install curl vim gridsite-clients net-tools -y
  1. Apache सेवा पुनः प्रारंभ करें:
root@kitploit:~
$ sudo systemctl restart apache2
  1. सुनिश्चित करें कि इंस्टॉल किया गया सॉफ़्टवेयर संस्करण कम से कम 2.9.x है:
root@kitploit:~
$ sudo apt-cache show libapache2-mod-security2

install

ModSecurity कॉन्फ़िगर करें

  1. फ़ाइल की कॉपी करें और नाम बदलें:
root@kitploit:~
$ sudo cp /etc/modsecurity/modsecurity.conf-recommended /etc/modsecurity/modsecurity.conf

अगला, ModSecurity डिटेक्शन मोड बदलें। पहले, cd /etc/modsecurity फ़ोल्डर में जाएं
2. ModSecurity कॉन्फ़िगरेशन फ़ाइल को vi, vim, emacs, या nano से संपादित करें।

root@kitploit:~
$ sudo vim /etc/modsecurity/modsecurity.conf
  1. फ़ाइल के शीर्ष के पास, आपको SecRuleEngine DetectionOnly दिखाई देगा। DetectionOnly को On में बदलें।

मूल मान: SecRuleEngine DetectionOnly
नया मान: SecRuleEngine On

modsec

  1. परिवर्तन सहेजें।
  2. Apache पुनः प्रारंभ करें:
root@kitploit:~
$ sudo systemctl restart apache2

OWASP कोर रूल सेट डाउनलोड करें

  1. CoreRuleSet.org/installation से नवीनतम CRS डाउनलोड करें
root@kitploit:~
$ cd ~
$ wget https://github.com/coreruleset/coreruleset/archive/refs/tags/v3.3.2.zip
  1. चेकसम सत्यापित करें, सुनिश्चित करें कि यह यहाँ सार्वजनिक रूप से उपलब्ध चेकसम से मेल खाता है: https://coreruleset.org/installation/
root@kitploit:~
$ sha1sum v3.3.2.zip && echo ProvidedChecksum
88f336ba32a89922cade11a4b8e986f2e46a97cf  v3.3.2.zip
ProvidedChecksum 

checksum

  1. ज़िप फ़ाइल को अनकंप्रेस करें।
root@kitploit:~
$ unzip v3.3.2.zip
  1. CRS सेटअप फ़ाइल को नई निर्देशिका से अपनी ModSecurity निर्देशिका में ले जाएं:
root@kitploit:~
$ sudo mv coreruleset-3.3.2/crs-setup.conf.example /etc/modsecurity/crs/crs-setup.conf
  • (वैकल्पिक लेकिन अनुशंसित) नियम निर्देशिका को नई निर्देशिका से अपनी ModSecurity निर्देशिका में ले जाएं:
root@kitploit:~
$ sudo mv coreruleset-3.3.2/rules/ /etc/modsecurity/crs/
  1. यह सुनिश्चित करने के लिए अपनी Apache security2.conf फ़ाइल संपादित करें कि यह ModSecurity नियमों को लोड करेगी:
root@kitploit:~
$ sudo vim /etc/apache2/mods-enabled/security2.conf
root@kitploit:~
<IfModule security2_module>
        # Default Debian dir for modsecurity's persistent data
        SecDataDir /var/cache/modsecurity

        # Include all the *.conf files in /etc/modsecurity.
        # Keeping your local configuration in that directory
        # will allow for an easy upgrade of THIS file and
        # make your life easier
        IncludeOptional /etc/modsecurity/crs-setup.conf
        IncludeOptional /etc/modsecurity/rules/*.conf

        # Include OWASP ModSecurity CRS rules if installed
        #IncludeOptional /usr/share/modsecurity-crs/*.load
</IfModule>

secmodule

  1. सुनिश्चित करें कि डिफ़ॉल्ट ModSecurity और नई CRS कॉन्फ़िगरेशन फ़ाइलें दोनों सूचीबद्ध हैं। पहली पंक्ति का conf फ़ाइल पथ पहले से शामिल हो सकता है। दूसरा फ़ाइल पथ वहाँ होना चाहिए जहाँ आपने /rules निर्देशिका को ले जाया है।
  2. /etc/apache2/apache2.conf संपादित करें
root@kitploit:~
$ sudo vim /etc/apache2/apache2.conf

निम्न कोड कॉपी और पेस्ट करें और इसे सहेजें।

root@kitploit:~
# Include list of ports to listen on
Include ports.conf

Include /etc/modsecurity/modsecurity.conf
Include /etc/modsecurity/crs/crs-setup.conf
Include /etc/modsecurity/crs/rules/*.conf

ports

Apache लोड मॉड्यूल Rewrite और Proxy

  1. निम्न मॉड्यूल कॉपी करें। Proxy और Rewrite मॉड्यूल सक्षम करें।
root@kitploit:~
$ cd /etc/apache2
$ sudo cp mods-available/proxy_http.load mods-enabled
$ sudo cp mods-available/proxy.load mods-enabled/
$ sudo cp mods-available/rewrite.load mods-enabled/
  1. Apache पुनः प्रारंभ करें
root@kitploit:~
$ sudo systemctl restart apache2

परीक्षण "मॉक्स" के लिए वर्चुअलहोस्ट जोड़ें

  1. पोर्ट जोड़ें, /etc/apache2/ports.conf संपादित करें
root@kitploit:~
$ sudo vim /etc/apache2/ports.conf

निम्न कोड कॉपी और पेस्ट करें और इसे सहेजें।

root@kitploit:~
# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default.conf

Listen 8080
Listen 18080

<IfModule ssl_module>
        Listen 443
</IfModule>

<IfModule mod_gnutls.c>
        Listen 443
</IfModule>

ports2

  1. /etc/apache2/sites-enabled पर जाएं, 001-test.conf फ़ाइल बनाएं
root@kitploit:~
$ cd /etc/apache2/sites-enabled/
$ sudo touch 001-test.conf
$ sudo vim 001-test.conf

निम्न कोड कॉपी और पेस्ट करें और इसे सहेजें।

root@kitploit:~
<VirtualHost *:8080>
        ServerName test.domain:8080

        SecRuleEngine On

        ErrorLog ${APACHE_LOG_DIR}/test_error.log
        CustomLog ${APACHE_LOG_DIR}/test_access.log combined
        SecAuditLog ${APACHE_LOG_DIR}/test_audit.log

        ProxyPass / http://127.0.0.1:18080/
        ProxyPassReverse / http://127.0.0.1:18080/
</VirtualHost>
  1. /etc/apache2/sites-enabled पर जाएं, 002-moc.conf फ़ाइल बनाएं
root@kitploit:~
$ cd /etc/apache2/sites-enabled/
$ sudo touch 002-moc.conf
$ sudo vim 002-moc.conf

निम्न कोड कॉपी और पेस्ट करें और इसे सहेजें।

root@kitploit:~
<VirtualHost 127.0.0.1:18080>

        ErrorLog ${APACHE_LOG_DIR}/moc_error.log
        CustomLog ${APACHE_LOG_DIR}/moc_access.log combined

        RewriteEngine On
        RewriteRule ^(.*)$ $1 [R=200,L]
</VirtualHost>
  1. apache पुनः प्रारंभ करें
root@kitploit:~
$ sudo systemctl restart apache2
  1. /etc/apache2/conf-enabled के अंदर wafparan01d3_rulesremove.conf फ़ाइल बनाएं
root@kitploit:~
$ sudo touch /etc/apache2/conf-enabled/wafparan01d3_rulesremove.conf
  1. Apache पुनः लोड करें
root@kitploit:~
$ sudo service apache2 reload

अपने FE और BE (मॉक) का परीक्षण करें

root@kitploit:~
Must be specify a domain , edit the following lines  

Windows:
C:\Windows\System32\drivers\etc\hosts
192.168.56.106 test.domain <-- add this line and specify your IP address  

Linux: 
/etc/hosts
192.168.1.23 test.domain <-- add this line and specify your IP address 

$ curl -i -k -s -XGET http://test.domain:8080/
HTTP/1.1 200 OK
Date: Mon, 22 Nov 2021 06:31:41 GMT
Server: Apache/2.4.41 (Ubuntu)
Content-Length: 571
Content-Type: text/html; charset=iso-8859-1
Vary: Accept-Encoding

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>200 OK</title>
</head><body>
<h1>OK</h1>
<p>The server encountered an internal error or
misconfiguration and was unable to complete
your request.</p>
<p>Please contact the server administrator at 
 [no address given] to inform them of the time this error occurred,
 and the actions you performed just before this error.</p>
<p>More information about this error may be available
in the server error log.</p>
<hr>
<address>Apache/2.4.41 (Ubuntu) Server at 127.0.0.1 Port 18080</address>
</body></html>

$ curl -i -k -s -XGET http://localhost:18080/
HTTP/1.1 200 OK
Date: Mon, 22 Nov 2021 06:27:17 GMT
Server: Apache/2.4.41 (Ubuntu)
Content-Length: 571
Content-Type: text/html; charset=iso-8859-1

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>200 OK</title>
</head><body>
<h1>OK</h1>
<p>The server encountered an internal error or
misconfiguration and was unable to complete
your request.</p>
<p>Please contact the server administrator at 
 [no address given] to inform them of the time this error occurred,
 and the actions you performed just before this error.</p>
<p>More information about this error may be available
in the server error log.</p>
<hr>
<address>Apache/2.4.41 (Ubuntu) Server at localhost Port 18080</address>
</body></html>

मैं इसका उपयोग कैसे करूं

सहायता के लिए आप help विकल्प का उपयोग कर सकते हैं। मूल उपयोग विभिन्न परिभाषित तर्कों को पारित करना है।
उदाहरण:

root@kitploit:~
$ sudo python3 wafparan01d3.py -h 

           (                                  )   ) (       )
 (  (      ))\ )          ) (      )        ( /(( /( )\ ) ( /(
 )\))(  ( /(()/( `  )  ( /( )(  ( /(  (     )\())\()|()/( )\())
((_)()\ )(_))(_))/(/(  )(_)|()\ )(_)) )\ ) ((_)((_)\ ((_)|(_)\
_(()((_|(_)(_) _((_)_\((_)_ ((_|(_)_ _(_/( /  (_) (_)_| |__ (_)
\ V  V / _` |  _| '_ \) _` | '_/ _` | ' \)) () || |/ _` ||_ \
 \_/\_/\__,_|_| | .__/\__,_|_| \__,_|_||_| \__/ |_|\__,_|___/
                |_|

                    ~ WAFPARANO1D3 : v1.1 ~
     The Web Application Firewall Paranoia Level Test Tool.

usage: wafparan01d3.py [-h] [--run [_RUN]] [--debug [_DEBUG]] [--pl [_PARANOIALEVEL ...]] [--proxy [_PROXY]] [--payload [_PAYLOAD]] [--rules-remove [_RULESREMOVE]] [--log [_LOG]] [--domain [_DOMAIN]] [--conf-file [_CONF_FILE]]
                       [--time-sleep [_TIME_TO_SLEEP]] [--time-sleep-request [_TIME_TO_SLEEP_REQUEST]] [--desc [_DESC]] [--output-desc [_OUTPUT_DESC]]

optional arguments:
  -h, --help            show this help message and exit
  --run [_RUN]          Run script
  --debug [_DEBUG]      Debug mode
  --pl [_PARANOIALEVEL ...]
                        Define paranoia level Ex. -pl 2
  --proxy [_PROXY]      Define Proxy. Ex: http://127.0.0.1:8081
  --payload [_PAYLOAD]  Define payload file. Ex. --payload payload2.txt
  --rules-remove [_RULESREMOVE]
                        Define rules remove file. Ex. --rules-remove rules1.txt
  --log [_LOG]          Define path of the log file. Ex. --log /var/log/apache/wafparan01d3.log
  --domain [_DOMAIN]    Define your domain. Ex. --domain example.domain:8080
  --conf-file [_CONF_FILE]
                        Define configuration file. Ex. --conf-file /opt/modsecurity/crs/rules/INITIALIZATION.conf
  --time-sleep [_TIME_TO_SLEEP]
                        Sleep time per PL. Ex. --time-sleep 3
  --time-sleep-request [_TIME_TO_SLEEP_REQUEST]
                        Sleep time per Request. Ex. --time-sleep-request 3
  --desc [_DESC]        Description of the script and authors
  --output-desc [_OUTPUT_DESC]
                        Description of the output on console mode.
                                                              

वैकल्पिक तर्क

root@kitploit:~
$ sudo python3 wafparan01d3.py -h 
	- show the help message

$ sudo python3 wafparan01d3.py --run
	- run the script with default options.

$ sudo python3 wafparan01d3.py --run --debug
	- Print every line on console.
	
$ sudo python3 wafparan01d3.py --run --pl 1
	- Run the script in assigned Paranoia Level.
	- By default runs on Paranoia Level 1, 2, 3, 4

$ sudo python3 wafparan01d3.py --run --payload file_payload2.txt
	- Define the payload file that you want to send to WAF.
	- By default takes the file mysql_gosecure.txt

$ sudo python3 wafparan01d3.py --run --rules-remove rules_removex.txt
	- Define the rules that you want to remove on GWAF.
	- Example of the file: 
		- Default 920000 920001 920002
	- By default takes the files: rules_remove1.txt, rules_remove2.txt, rules_remove3.txt, rules_remove4.txt

$ sudo python3 wafparan01d3.py --run --log /home/waf_user/paranoia.log
	- Define LOG File.
	- By default print the log on paranoia_debug.log

$ sudo python3 wafparan01d3.py --run --domain mydomain.test.com
	- Define Domain of Front End WAF.
	- By default runs over domain domain.test:8080
	
$ sudo python3 wafparan01d3.py --run --conf-file /opt/modsecurity/crs/rules/INITIALIZATION.conf
	- Define the configuration file to update the Paranoia Level
	- By default takes /etc/modsecurity/crs/rules/REQUEST-901-INITIALIZATION.conf

$ sudo python3 wafparan01d3.py --run --time-sleep 3
	- Define the time to sleep per Paranoia Level.

$ sudo python3 wafparan01d3.py --run --time-sleep-request 2
	- Define the time to sleep per request send to WAF.

$ sudo python3 wafparan01d3.py --desc
	- Print the description of the script and the authors.

डेमो

आप wafparan01d3.py को VM वातावरण (Ubuntu) चलाकर आज़मा सकते हैं जो नवीनतम OWASP कोर रूल सेट CRS 3.3.2 का उपयोग करके WAF ModSecurity और 'मॉक' तैनात करता है, जो ModSecurity पैरानॉइड स्तरों का आसानी से अनुकूलन योग्य मूल्यांकन करता है।

चलाने के लिए:

root@kitploit:~
$ git clone https://github.com/alt3kx/wafparan01d3.git
$ cd wafparan01d3
$ sudo python3 wafparan01d3.py --help 
root@kitploit:~
$ sudo python3 wafparan01d3.py --run

wafparan01d3_001

root@kitploit:~
$ sudo python3 wafparan01d3.py --run --debug --proxy http://192.168.56.1:8081

wafparan01d3_002

root@kitploit:~
$ sudo python3 wafparan01d3.py --run --debug --pl 1 2 --proxy http://192.168.56.1:8081 --log test.log --domain vulnerable.domain:8080 --time-sleep-request 1 --time-sleep 1 --rules-remove my_rules_remove.txt --payload my_payload.txt

wafparan01d3_003

WAF Rule Scientific Notation

https://github.com/mindhack03d/WAF-Rule-Scientific-Notation

लेखक

एलेक्स हर्नांडेज़ उर्फ (@_alt3kx_)
जीसस ह्यूर्ता उर्फ @mindhack03d

टूल डाउनलोड करें