directory-traversal Questions

6

Solved

opendir(DIR,"$pwd") or die "Cannot open $pwd\n"; my @files = readdir(DIR); closedir(DIR); foreach my $file (@files) { next if ($file !~ /\.txt$/i); my $mtime = (stat($file))[9]; print $mtime;...
Cockaigne asked 7/3, 2012 at 11:14

3

Solved

I need to prevent from directory traversal attack from my code using Python. My code is below: if request.GET.get('param') is not None and request.GET.get('param') != '': param = request.GET.get(...
Contrail asked 19/7, 2017 at 11:5

8

I have a base path /whatever/foo/ and $_GET['path'] should be relative to it. However how do I accomplish this (reading the directory), without allowing directory traversal? eg. /\.\.|\.\./ W...
Gertrudgertruda asked 17/11, 2010 at 14:4

10

Solved

I am working on a script that needs to perform an action in every sub-directory of a specific folder. What is the most efficient way to write that?
Disused asked 22/10, 2010 at 20:15

10

I want to copy a directory from one drive to another drive. My selected directory contains many sub directories and files. How can I implement the same using Qt?
Unparalleled asked 29/3, 2010 at 8:11

3

Solved

Is the following code snippet from a Python WSGI app safe from directory traversal? It reads a file name passed as parameter and returns the named file. file_name = request.path_params["file"] fil...
Calandracalandria asked 23/7, 2011 at 21:45

5

I would like to normalize a path from an external resource to prevent directory traversal attacks. I know about the realpath() function, but sadly this function returns only the path of existing di...
Otology asked 8/4, 2012 at 16:44

3

I want to verify that my web application does not have a path traversal vulnerability. I'm trying to use curl for that, like this: $ curl -v http://www.example.com/directory/../ I would like th...
Written asked 24/7, 2014 at 14:24

5

Solved

I am writing a program that should process many small files, say thousands or even millions. I've been testing that part on 500k files, and the first step was just to iterate a directory which has ...
Tillotson asked 8/1, 2015 at 16:33

4

Is there some recursive directory walker in Haskell so I could write something like listing <- walkDir "/tmp" I would not like to write my own. I can install some dependency from cabal but I ...
Elinorelinore asked 8/11, 2012 at 21:12

3

Solved

I'm just getting started with Python but already have found it much more productive than Bash shell scripting. I'm trying to write a Python script that will traverse every directory that branches ...
Responsiveness asked 24/3, 2011 at 15:30

2

I have a directory of music that has album folders as well as individual songs on each level. How can I traverse all of these files that also are encoded in different formats(mp3, wav etc)? In addi...
Anna asked 25/10, 2011 at 19:5

1

Solved

How do I get this piece to follow symlinks in python 2.6? def load_recursive(self, path): for subdir, dirs, files in os.walk(path): for file in files: if file.endswith('.xml'): file_path = os....
Meditation asked 22/9, 2010 at 16:57

1

Solved

I am implementing a simple directory listing script in PHP. I want to ensure that the passed path is safe before opening directory handles and echoing the results willy-nilly. $f = $_GET["f"]; if...
Lapp asked 11/5, 2009 at 9:9

7

How do you traverse a directory tree in your favorite language? What do you need to know to traverse a directory tree in different operating systems? On different filesystems? What's your favorit...
Drown asked 30/1, 2009 at 21:7
1

© 2022 - 2024 — McMap. All rights reserved.