Old school code audit?

SUSE Hackweek 10

Shawn the R0ck Oct 12 2013

whois

Old good hacking days? strcpy( fucked, buf, xXx); 1990s: grep strcpy *.c printf(s_as_string); around 2000: grep –E –e ‘printf\s*\([^”]+[,\)]’ *.c

Audit was never easy as you think Let's talk about file, permission..... ●

8 400 r-------- Owner may read



7 200 -w------- Owner may write



6 100 --x------ Owner may execute



5 040 ---r----- Group may read



4 020 ----w---- Group may write



3 010 -----x--- Group may execute



2 004 ------r-- Everyone else may read



1 002 -------w- Everyone else may write



0 001 --------x Everyone else may execute

More default polices? *GNU/Linux: use gid of the creating process( you can change this policy in mount options*) *BSD: use gid of the parent directory Hard link example: -------------------------------------echo 'hello hard link!' > test.log ln test.log my_hardlink -------------------------------------test.log and my_hardlink are only one inode which contains the same content. The name and inode pair will be removed permanently( really?) only if the link count of its inode equal to zero.

HOWTO? *Kernel will give you anwser: kernel/include/linux/fs.h struct inode { ........... unsigned int ........... };

i_nlink;

Exceptional handler OK. You thought you are a good programmer. But...maybe you are just another fuc*ing monkey coder. Just don't realize what you're doing is fuc*ing wrong........ E.g: Int ret = read(fd, potential_threat, size_is_l33t); if( ret == -1){ ….............. // that's it?

Read everything even something bad happened. End conditions are: ●

--------------------------------------------------------------------------------



read all len bytes( return len) or EOF is reached( return zero).



--------------------------------------------------------------------------------



And, execeptional handling:



--------------------------------------------------------------------------------



return a value less than len, re-calculate the buffer and number



of bytes haven't read yet, then reissue read() again.



return -1 and errno=EINTR, it's signal break before read anything.



return -1 and errno=?, loop terminates



--------------------------------------------------------------------------------

● ●

void read_all(int fd, void *buf, size_t len)



{



ssize_t ret;



while (len != 0 && (ret = read(fd, buf, len)) != 0) { if (ret == -1) {



if (errno == EINTR) /* EINTR = signal break, EAGAIN = no data currently available */

● ●

continue;



perror("read");



break;



}



len -= ret;



buf += ret; }

● ●

}

More sides of the desert of the real Standard I/O functions: good, popular, etc.... fflush() is ensure that the user-space buffer is written out to the kernel...just the kernel...then fsync() is ensure that the kernel buffer is written out to disk. sync()? Well, that's too old school?

Hackweek 10 Awesome week! * Hack anything you want * Just boring code audit? No shit---> * Telco sec shit are looks awesome Step-1: Software defined radio-->listen to fm->scan specific frequency-->locating airplane's info by Mode S transsmisson-->IR detection? well, I can't tell. Step-2: Telco network protocol working with TCP/IP in one fuc*ing device....catch any info in the air, and in the wire

Gratitude * SUSE gave us a week to think who we are! Very philosophical! * People who was inspired by Phrack and underground spirit * Bo Yang, fuc*ing awesome technical( note: not philosophical;-)) hacker I've rarely to met * My neurons, I couldn't do anything without their commitment. No kidding;-) ***

Questions? This is where we are............

Dude, keep hacking is our only choice to be alive

Old school code audit? - GitHub

Awesome week! * Hack anything you want. * Just boring code audit? No shit--->. * Telco sec shit are looks awesome. Step-1: Software defined radio-->listen to ...

2MB Sizes 4 Downloads 312 Views

Recommend Documents

Code Library - GitHub
Sep 13, 2013 - Contents. 1 Data Structure. 1. 1.1 atlantis . .... 4.25 Second-best MST . ...... prime is good. 10 static const int MAXX=47111; // bigger than. √ c. 11.

Old Dominion University Lecture 2 - GitHub
Old Dominion University. Department of ... Our Hello World! [user@host ~]$ python .... maxnum = num print("The biggest number is: {}".format(maxnum)) ...

School Code Unification
Responsibilities of School HM/Principal. Page 3. www.itschool.gov.in. Page 4. Login Screen. Page 5. GENERAL SCHOOL SECTION. Page 6. ENTRY FORM ...

The Pirate Copyright Code - GitHub
law should be in the information age not the way it has to be to satisfy the last milleniums ... subsequent exploitation regulations for the case the economic rights expired with the author still ..... dicial proceedings or public security; c. use fo

101 Ruby Code Factoids - GitHub
You can add the current directory to your load path with: .... Apple.chew. # => "munch munch" def Apple.cut. "chop chop" end. Apple.cut ..... 61) Method#owner.

old-school-by-tobias-wolff.pdf
Feb 7, 2005 - hero, is coming to the school. The competition intensifies, and the morals the school and the boys. pride themselves on - honour, loyalty and ...

Old Coronation School 10.pdf
7 days ago - ac felly nid yw'n ystyried unrhyw gais a. gyflwynir ar ôl yr amser hwnnw hyd yn oed. os yw'n aros i'w brosesu yng Nghofrestrfa. Tir EM ar adeg ...

Old Coronation School 31.pdf
Nov 8, 2017 - sy'n gyfredol ar 8 NOV 2017 am 22:01:48. ac felly nid yw'n ystyried unrhyw gais a. gyflwynir ar ôl yr amser hwnnw hyd yn oed. os yw'n aros i'w ...

School Code IT.pdf
Thiruvananthapuram 42338 Govt. L P S Venjaramoodu. Thiruvananthapuram 42339 U P S Kunnuvaram. Thiruvananthapuram 42340 Y L M U P S Keezhattingal.

Open Source Code Serving Endangered Languages - GitHub
ten called low-resource, under-resourced, or minority lan- guages) ... Our list is updatable more ... favorites on other social media sites, and, generally, a good.

Marching Up and Down the Code - GitHub
CONTENTS. 0 Starting with Python's IDLE. 1. 0.0 Introduction . ..... Knowing how to program a computer is a great skill to have, even if you are not a ..... need to take the value of age from the present year, 2015, and then add on 100. ..... Draw a

HDL-BUS control and operate code - GitHub
Operate code. Function. Targets address. Additional data format(every 9 data) ..... x value of volume(79 small-----0 big). Return #Zz,ON,SRC1,VOL38.

Clean Code “Error Handling” - GitHub
It's your job. Do it. Error handling isn't a curse, or a bother. Things can and do go wrong. Thus, error handling is an essential part of programming. And, since it ...

Clean Code “Unit Tests” - GitHub
It's more what you'd call a "guideline" ... LinkedHashMap groups = ... assertEquals("+SHRA +FC FZDZ +TSRAGR", groups.get(WEATHER));.

Green School Walkability Audit - St Michaels Edited.pdf
Green School Walkability Audit - St Michaels Edited.pdf. Green School Walkability Audit - St Michaels Edited.pdf. Open. Extract. Open with. Sign In. Main menu.

s Complete Expository Dictionary of Old and New ... - GitHub Pages
quickly get at the heart of a word's meaning without wading through more technical studies. ... grow to be full because you can have it inside your lovely laptop.

School of Informatics Data Hack- Geo.pptx - GitHub
Feb 18, 2013 - Build spa-al queries from user or sensor inputs. – Return results in several different formats: • kml, json, xml, txt, georss… – Returns, points, bounding boxes, footprints… • Unlock Text. – generates a list of places fro