Home
Calendar
Certifications
Columns
Features
Forum
Resources
Vitals
Latest Additions
April 2013 Free Giveaway Sponsor - eLearnSecurity
Human Intelligence to Navigate the Security Data Deluge
February 2013 Free Giveaway Winner of SANS CyberCon Training
Interview: Bugcrowd Founders on Herding Ninjas for Crowdsourced Bug Bounties
Network Forensics: The Tree in the Forest
March 2013 Free Giveaway Sponsor - Mile2
Book Review: Violent Python
February 2013 Free Giveaway Sponsor - SANS
Holiday 2012 Free Giveaway Winner of Metasploit Pro by Rapid7
Course Review: SANS FOR408 Computer Forensic Investigations – Windows In-Depth
The Security Consulting Sugar High
Tutorial: Fun with SMB on the Command Line
Interview: Ilia Kolochenko, CEO of High-Tech Bridge
October 2012 Free Giveaway Winner of LearningGate Training
The Broken: Assessing Corporate Security in 2012 to Make a Better 2013
EH-Net Login
Welcome Guest.
Username:
Password:
Remember me
Lost Password?
No account yet?
Register
Who's Online
We have 49 guests online
You are here:
Home
Ethical Hacking Discussions and Related Certifications
Programming
Using Assembly to access locked files
EH-Net
May 20, 2013, 01:53:44 AM
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
: Go back to The Ethical Hacker Network Online Magazine
Home Page
Home
Help
Calendar
Login
Register
EH-Net
>
Ethical Hacking Discussions and Related Certifications
>
Programming
(Moderator:
don
) >
Using Assembly to access locked files
Pages: [
1
]
Go Down
« previous
next »
Print
Author
Topic: Using Assembly to access locked files (Read 6667 times)
0 Members and 1 Guest are viewing this topic.
Ketchup
Hero Member
Offline
Posts: 1021
Using Assembly to access locked files
«
on:
November 20, 2008, 10:28:43 PM »
Hey all,
Pardon my Assembly ignorance. I am wondering if you can use Assembly language to access files locked for exclusive access by Windows. For example, can I use Assembly to gain read access to Index.dat or the Swap File? I am not entirely sure how you go about doing this since Windows locks files based on their Handles. Since Assembly has lower level access, I am wondering if there are way to circumvent file locks. Anyone have experience with this?
Numerous hex editors have circumvent file locks by reconstructing the file system on the fly. I wonder if there is an easier way.
Logged
~~~~~~~~~~~~~~
Ketchup
NickFnord
Full Member
Offline
Posts: 117
Re: Using Assembly to access locked files
«
Reply #1 on:
November 21, 2008, 05:24:17 AM »
Quote from: Ketchup on November 20, 2008, 10:28:43 PM
Since Assembly has lower level access,
I'm a relative newbie at assembly language programming also, so I'm not going to try to answer your main question, but I'm really curious as to why you think assembly has "lower level access" than any other programming language, and what that exactly means.
seeing as all compiled languages all end up running as machine code which can be directly translated into assembly language, you should be able to do most things with most languages, writing assembly just gives you a finer level of control.
anyway, just thoughts.
Logged
Ketchup
Hero Member
Offline
Posts: 1021
Re: Using Assembly to access locked files
«
Reply #2 on:
November 21, 2008, 08:38:41 AM »
Well, like I said, I am an Assembly n00b. Perhaps I phrased this wrong. I believe that Assembly doesn't use file handles for I/O operation. If I can access NTFS directly through Assembly, I may be able to bypass Windows file locking APIs. NTFS doesn't lock files, Windows does it through File Handles. Does this make more sense?
Logged
~~~~~~~~~~~~~~
Ketchup
geekyone
Full Member
Offline
Posts: 180
Re: Using Assembly to access locked files
«
Reply #3 on:
November 21, 2008, 03:59:46 PM »
*Caveat* I am not an Assembly guru by any stretch of the imagination.
From what I know you are correct that Assembly doesn't use file handles it uses memory addresses instead (I think). You could definitely write an Assembly program that accessed a locked file using it's memory address. Although you might be limited in what you could do with it.
Logged
CISSP, CEH, GPEN, GCIH, GCFA
Ketchup
Hero Member
Offline
Posts: 1021
Re: Using Assembly to access locked files
«
Reply #4 on:
November 21, 2008, 04:30:53 PM »
Thanks. I suppose the trick would be to figure out how to translate the Windows file Handle to a memory address.
Logged
~~~~~~~~~~~~~~
Ketchup
apollo
Full Member
Offline
Posts: 146
Re: Using Assembly to access locked files
«
Reply #5 on:
November 21, 2008, 07:56:29 PM »
So.. I'm not a windows kernel hacker, but here is some speculation. My guess would be that the ideal way to get to the things that you want is not assembly, but instead dll injection. If you want to delete locked files, process explorer can probably help you. If you want to scrape program memory, a debugger or such can be your best friend. So I guess the real question is, what is your goal. A file handle is basically just a view into the file that the operating system helps you keep track of so that you aren't doing a lot of other work that the operating system is already doing for you. Files aren't always in one place on the disk, so the file handle makes sure you don't have to deal with that. If you are trying to do something specific with these files, elaborate a little more and there may be some tools out there that will help you do what you'd like without writing any code.
Logged
CISSP, CSSLP, MCSE+Security, MCTS, CCSP, GPEN, GWAPT, GCWN, NOP, OSCP, Security+
Ketchup
Hero Member
Offline
Posts: 1021
Re: Using Assembly to access locked files
«
Reply #6 on:
November 24, 2008, 01:34:14 PM »
Hmm, dll injection may be an option. I hadn't thought of that. What I am trying to do is mainly copy certain files for offline analysis while the machine is running. For example, I am trying to copy pagefile.sys and SYSTEM (registry). I don't need to view or delete them from the default location.
I can get these files by doing a complete live image, but that type of acquisition has other issues, like bit shifting and time requirements.
Logged
~~~~~~~~~~~~~~
Ketchup
Pages: [
1
]
Go Up
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
EH-Net
-----------------------------
=> Calendar Of Events
===> ChicagoCon 2007
===> ChicagoCon 2008s
===> ChicagoCon 2008f
===> ChicagoCon 2009s
=> Ethical Hacktivism
=> News Items and General Discussion About EH-Net
===> Greetings
=> Special Events
-----------------------------
Ethical Hacking Discussions and Related Certifications
-----------------------------
=> General Certification
===> Networking
===> OS
===> Security
=> Compliance, Regulations & Standards
=> Control Systems
=> Cyber Warfare
=> Forensics
===> CCE / MCCE - (Master) Certified Computer Examiner
===> CHFI - Computer Hacking Forensic Investigator
===> EnCE - EnCase® Certified Examiner
===> GCFA - GIAC Certified Forensics Analyst
=> Hardware
=> Incident Response
===> CSIH - Computer Security Incident Handler
===> GCIH - GIAC Certified Incident Handler
=> Malware
===> Advisories
=> Mobile
=> Network Pen Testing
===> CEH - Certified Ethical Hacker
===> CPTC - Certified Penetration Testing Consultant
===> CPTE - Certified Penetration Testing Engineer
===> CSTA - Certified Security Testing Associate
===> eCPPT - eLearnSecurity Certified Professional Penetration Tester
===> ECSA - EC-Council Certified Security Analyst
===> GPEN - GIAC Certified Penetration Tester
===> OSCP - Offensive Security Certified Professional
=> Physical Security
=> Programming
=> Social Engineering
=> Web Applications
=> Wireless
===> CWNP Certs
===> GAWN - GIAC Assessing Wireless Networks
===> OSWP - Offensive Security Wireless Professional
=> Other
-----------------------------
Columns
-----------------------------
=> Editor-In-Chief
=> Andress
=> Gates
=> Haddix
=> Hadnagy
=> Heffner
=> Hoffman
=> Linn
=> RichM
=> Murray
=> J. Peltier
=> Weidman
=> Wilson
-----------------------------
Features
-----------------------------
=> /root
=> Book Reviews
=> Opinions
=> Skillz
===> Examples
===> May 06 - Star Hacks, Episode V: The Empire Hacks Back
===> July 06 - Hack Bill!
===> Sept 06 - Netcat in the Hat
===> Nov 06 - Hitch-Hackers Guide to the Galaxy
===> Dec 06 - A Christmas (Hacking) Story
===> Feb 07 - Charlottes Web Site
===> April 07 - Microsoft Office Space
===> June 07 - Serenity Hack
===> Oct 07 - Worst. Ethical. Hacker. Challenge. Ever.
===> Dec 07 - Frosty the Snow Crash
===> March 2008 - It Happened One Friday
===> Oct 2008 - Scooby Doo and the Crypto Caper
===> Dec 08 - Santa Claus Is Hacking to Town
===> Feb 2009 - Brady Bunch Boondoggle
===> July 2009 - Prison Break
===> October 2009 - SSHliders
===> December 2009 - Miracle on Thirty-Hack Street
===> December 2010 - The Nightmare Before Charlie Browns Christmas
-----------------------------
Resources
-----------------------------
=> Career Central
===> Looking For Work
===> Looking To Hire
=> Links to cool sites.
=> Mass Media
=> News from the Outside World
=> Tools
=> Tutorials
===> Tutorial Requests
Loading...
Exclusive Deal
SANSFIRE 2013
June 15 - 22
5% Off
w/ Code
:
EHN_5
SANS Deals 4 EH-Netters
5% OFF
Any
SANS Course
in Any Format!
Coupon Code:
EHN_5
Including
SANS Rocky Mountain 2013
&
SANS Boston 2013
Polls
Compared to this year, 2013 will be:
Great!
Better.
About the same.
Little worse.
FUBAR!
Recent Forum Topics
OSCP - Offensive Security Certified Professional
: Failed my first attempt at the OSCP exam
(86) by
impelse
Tutorials
: Need guidance
(8) by
r0ckm4n
OSCP - Offensive Security Certified Professional
: Class Scheduled 6/8 - Linux n00b
(7) by
Taemyks
OSCP - Offensive Security Certified Professional
: OSCP exam scheduled
(6) by
gbhat
Incident Response
: LinkedIn Forensics
(0) by
AFENTIS_Forensics
General Certification
: Red Team/Blue Team
(1) by
ajohnson
Career Central
: Starter cert?
(3) by
Grendel
Network Pen Testing
: Beginner Ethical Hacker
(1) by
m0wgli
General Certification
: CPT Practical Submission
(0) by
z28power4u
Web Applications
: Nessus and Nikto
(4) by
Seen
Malware
: EICAR?
(2) by
SephStorm
Network Pen Testing
: Cracking salted MD5 hash
(4) by
n37sh@rk
CEH - Certified Ethical Hacker
: Passed my C|EH
(3) by
n37sh@rk
Mass Media
: EC-council hacked, irony at his best?
(0) by
j0rDy
Web Applications
: SQL Injection into an INSERT statement.
(6) by
eyenit0
Network Pen Testing
: Solution for sipXtapi INVITE Message CSeq Field Header Remote Overflow
(1) by
m0wgli
Web Applications
: dns
(2) by
H1t M0nk3y
Other
: BSides Boston
(0) by
3xban
Career Central
: InfoSec in Central, FL
(2) by
tturner
Web Applications
: Web vulnerability scanner
(4) by
H1t M0nk3y
EH-Net News Feeds
Latest Additions
Privacy Notice
for TDCC & All Properties
© 2013 The Ethical Hacker Network
Joomla!
is Free Software released under the GNU/GPL License.