• Stars
    star
    417
  • Rank 103,829 (Top 3 %)
  • Language
    Python
  • License
    GNU General Publi...
  • Created over 11 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

simple script to extract all web resources by means of .SVN folder exposed over network.

Svn-Extractor

Many a times web application pen-testers are encountered with the presence of .svn folders. For those not aware .svn folder is used by SVN version control system to perform its operations. For a blackbox pentest this folder contains huge amount of information. Some of the key areas where this can help includes.

  1. Uncover hidden files and folder names

  2. Access the source code of the files.

  3. download files even if the restrictions are in place at htaccess.

How this could be achieved.

  1. Uncover hidden files and folder names

There are two ways in which this can be achieved based on the version of SVN in use.
for <1.6 we had .svn/entries files which contained list of files / folders as well as usernames used for commiting those files.
for >1.6 we have .svn/wc.db which contains simmilar data but in a sqlite3 format.
These files could be directly accessible through url.

  1. Access the source code / download files even if htaccess blocks its access.

SVN keeps a backup copy of all files in two seperate locations.

  1. .svn/text-base/ "filename" .svn-base
  2. .svn/pristine/ "XX" / "CHECKSUM" .svn-base

where

filename is actual name of file.

CHECKSUM is Sha1 sum of the file

XX is first two character of CHECKSUM.

first type of entries has one limitations suppose file name is testme.php so path becomes.

.svn/text-base/testme.php.svn-base

a large number of servers will execute the file and serve the output.

that's where option 2 shines however this information is available only in case of wc.db (>1.6 SVN version) and this requires that .sv/pristine directory should be web accessible.

However after searching a lot i was not able to find a single code which can do both these things in one go.

so here is a tool which can perform both the operations in one script.

Usage

minimal

svn-extractor.py --url "url with .svn available"

alloptions

$ python svnextractor.py --help  
usage: svn_extractor.py [-h] --url TARGET [--debug] [--noextract] [--userlist]
                        [--wcdb] [--entries] [--proxy PROXY] [--match MATCH]

This program is used to extract the hidden SVN files from a webhost
considering either .svn entries file (<1.6) or wc.db (> 1.7) are available
online. This program actually automates the directory navigation and text
extraction process

optional arguments:
  -h, --help     show this help message and exit
  --url TARGET   Provide URL
  --debug        Provide debug information
  --noextract    Don't extract files just show content
  --userlist     show the usernames used for commit
  --wcdb         check only wcdb
  --entries      check only .svn/entries file
  --proxy PROXY  Provide HTTP Proxy in http(s)://host:port format
  --match MATCH  only download files that match regex

Credit (C) Anant Shrivastava http://anantshri.info Greets to Amol Naik, Akash
Mahajan, Prasanna K, Lava Kumar for valuable inputs

References

It would be unfair to say that i did all the research myself so here are the links to various resources i used to get the info out.

  1. http://pen-testing.sans.org/blog/pen-testing/2012/12/06/all-your-svn-are-belong-to-us (manual technique for wc.db)

  2. http://www.adamgotterer.com/post/28125474053/hacking-the-svn-directory-archive (manual technique for .svn/entries)

  3. http://www.cirt.net/svnpristine (only automated tool i can find online doing wc.db magic)

More Repositories

1

Android_Security

This repository is a suplimentary material for Android Training's done by Anant Shrivastava from 2012-2017
C
217
star
2

wp-security

Wordpress security functions for paranoid folks. (themes functions.php and .htaccess). Take what you want, leave what you think should be added to it.
PHP
162
star
3

DS_Store_crawler_parser

a parser + crawler for .DS_Store files exposed publically
Python
52
star
4

github_cloner

Clone github repositories of a user / organization
Python
47
star
5

html5_attack_and_secure

HTML5 Training material for Attack and Secure training sessions.
JavaScript
43
star
6

script-collection

Collection of my scripts ranging from bash or python or shell. Readme will contain list of which script does what.
Python
36
star
7

wpvulndb_cmd

A commandline vulnerability reporter using WP-CLI and WPVulnDB
Python
30
star
8

present

revealjs workflow automation: reveal.js + external markdown mixed with some bash awesomeness to automate routine presentation tasks
Shell
26
star
9

premotedroid

Github fork of premotedroid to work on issues pending in google code as developer is non responsive.
Java
9
star
10

Chromifier-for-nix

A bash script to convert web applications into independent chrome/chromium based standalone applications. Usable scripts for mac and linux machines included
Shell
8
star
11

server_admin_scripts

A collection of various scripts in perl/python/bash which i use while administering my own servers.
Shell
7
star
12

mac_notification_hacks

Some of the notification hacks i use daily
Shell
7
star
13

manual_verification

Most of the times during pentest / vulnerability assessment you need to verify a finding before marking it as confirmed or false positive. This repository will try to put in sample code snippets / command's that can be used to perform that.
JavaScript
7
star
14

Obsidian_stuff

Various stuff and tweaks I have around Obsidian
6
star
15

fediverse_osint

OSINT on fediverse Instances
Python
3
star
16

null_puliya_Linux_basics

2
star
17

Dom-xss_validator

a rudimentary dom-xss validator by sending crafted payload and expecting a response on a user controlled server.
JavaScript
2
star
18

anantshri

2
star
19

bug_mania

Bug Mania
2
star
20

androidtamer

Project moved to its own organization. Raise issue here: https://github.com/AndroidTamer/Tools_Repository/issues
2
star
21

debian-ppa

Script to install ppa's in debian
Shell
1
star
22

wordpress_tricks

Personal Repository of wordpress tricks that i work on during day to day life
PHP
1
star
23

gotosocial_bulk_follow

Bulk Follow Script for GoToSocial
Python
1
star
24

fediverse_scripts

Various scripts created for quick stats extraction from different fediverse accounts
Shell
1
star