Previous Thread
Next Thread
Print Thread
Rate Thread
#7672 11/27/02 01:31 PM
Joined: Nov 2002
Posts: 1
Junior Member
Junior Member
Joined: Nov 2002
Posts: 1
As part of a class project I need to write an exploit for the read below:

Code
unsigned char data[200];
int i,j,n;
 
n=open(filename, O_RDONLY);
 
i=-1;
do{
i++;
j=read(n,data+i,1);
}while(j>0);
I have the binary code for NOP/open a shell/etc, but I can't figure out how to store it correctly in data since I have to read from a file - It ends up stored as ascii characters, having different values from what I need.

Any help would be appreciated.

Sponsored Links
▼ Sponsored Links ▼ ▲ Sponsored Links ▲
#7673 11/27/02 05:34 PM
Joined: May 2002
Posts: 189
Member
Member
Joined: May 2002
Posts: 189
isnt this what they would call cheating...
(i couldnt help you anyway)

#7674 11/28/02 07:22 AM
Joined: Mar 2002
Posts: 1,273
DollarDNS Owner
DollarDNS Owner
Joined: Mar 2002
Posts: 1,273
Are you trying to get a buffer overflow with that? seems you're reading characters from a file one at a time into the data buffer. If you read over 200 bytes, then possibly the data in the file after 200 bytes could be shell code and somehow get it executed. But anyway, that seems awefully vague.


Domain Registration, Hosting, Management
http://www.dollardns.net

Link Copied to Clipboard
Member Spotlight
None yet
Forum Statistics
Forums41
Topics33,840
Posts68,858
Members2,176
Most Online3,253
Jan 13th, 2020
Latest Postings
Top Posters
UGN Security 41,392
Gremelin 7,203
§intå× 3,255
SilentRage 1,273
Ice 1,146
pergesu 1,136
Infinite 1,041
jonconley 955
Girlie 908
unreal 860
Top Likes Received
Ghost 2
Dartur 1
Cyrez 1
Girlie 1
unreal 1
Powered by UBB.threads™ PHP Forum Software 8.0.0