일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
- web
- Los
- 화이트햇콘테스트
- ubuntu
- rubiya
- lordofsqlinjection
- 해킹
- SQLInjection
- CCE
- 운영체제
- webhackingkr
- WebHacking
- crosssitescripting
- hacking
- sqli
- SQL
- 시스템프로그래밍
- 알고리즘
- Python
- ctf
- webhacking.kr
- Linux
- 프로세스
- Writeup
- CODEGATE
- 상호배제
- 시스템
- XSS
- SQL Injection
- 웹해킹
- Today
- Total
목록ubuntu (5)
One_Blog
![](http://i1.daumcdn.net/thumb/C150x150.fwebp.q85/?fname=https://blog.kakaocdn.net/dn/cFCJ2q/btr4qzQ66Zs/0shIKmOsjMLX4A3hH5XEK1/img.png)
#include #include #include #include #include #include #include int main(int argc,char **argv) { if(argc!=3) exit(0); file1(argv[1]); file2(argv[2]); } void file1(char *filename) { int fd = open(filename, O_RDWR,0644); //int fd = open(filename, 0_asd | O_dsa, 0644); if (fd < 0) { printf("%s(%d)\n",strerror(errno),errno); } } void file2(char *filename) { int fd = open(filename,O_RDWR|O_CREAT, 0644..
#include #include #include #include #include #include int main(int argc,char **argv) { if(argc!=2) exit(0); file1(argv[1]); } void file1(char *filename) { int fd = open(filename,O_RDWR|O_CREAT, 0644); char a[1024] = "01234567890123"; write(fd, a, 10); close(fd); fd = open(filename, O_RDWR, 0644); char b[1024]={}; read(fd,b,6); close(fd); printf("%s\n",b); }
#include int main() { writeFile(); readFile(); } void writeFile() { FILE *fp; fp = fopen("testFile","w"); fprintf(fp, "File Write Test!\n"); char testStr[1024] = "Test String.\n"; fwrite(testStr, 100, 1, fp); fclose(fp); } void readFile() { FILE *fp; char str[1024]; fp = fopen("testFile","r"); fgets(str,1024,fp); printf("%s",str); fread(str,1024,1,fp); printf("%s\n",str); fclose(fp); } 😀
![](http://i1.daumcdn.net/thumb/C150x150.fwebp.q85/?fname=https://blog.kakaocdn.net/dn/dMZDLM/btr4hRyION8/VlV5uiXOBCDRC0kBObxKHk/img.png)
#include #include #include #include #include #include #include int main(int argc, char **argv) { if(argc!=2) exit(0); filei(argv[1]); fileo(argv[1]); } void filei(char *filename) { int fd = open(filename, O_RDWR | O_CREAT, 0644); char flag[1024] = {}; scanf("%s",flag); write(fd, flag, 25); printf("%s\n",flag); close(fd); } void fileo(char *filename) { int fd = open(filename, O_RDWR | O_CREAT, 06..