生物体内是否存在tmp和dump.tmp是什么

当前位置: →
→ 执行mysqldump的权限有关问题
执行mysqldump的权限有关问题
& 作者:佚名 & 来源: 互联网 &
&收藏到→_→:
摘要: 执行mysqldump的权限问题打算在php页面通过按钮点击,实现整个数据库的备份 $tmpname= &wholesystem.sql &; unlink($setupdirection. &/tmp/$tmpname &); $comma
"执行mysqldump的权限有关问题"::
执行mysqldump的权限问题打算在php页面通过按钮点击,实现整个 的备份
$tmpname= &wholesystem.sql &;
unlink($setupdirection. &/tmp/$tmpname &);
$command= &mysqldump & --opt & --default-character-set=latin1 & -u & $dbusername & -p &.$dbuserpass. & & $dbnames & &
&.$setupdirection. &/tmp/$tmpname &;
system($command); &
download($setupdirection. &/tmp/ &,$tmpname, & $tmpname);
$command打印出来的内容在命令行中进入mysql的安装路径的bin下,执行成功!!
但通过以上代码,输出的总是一个空的sql文件
我知道原因是mysqldump直接在命令行中执行,而不是内部命令,必须进入mysql的安装路径的bin下执行才行
难道非要把mysql安装路径存下来?以后系统移植就麻烦了
请问有没别的办法让$command运行啊?------ --------------------既然考虑系统移植,那就应该指定全路径,不同的系统,甚至不同的安装肯定会把命令放到不同的路径下,包括你的目的目录,不同的系统肯定不一样。
建议你考虑用show create table加上select into outfile,然后用load data infile。
------ --------------------不知道楼上说的是什么意思,
怎么需要多次 运行?
在多个 中 ?
mysqldump -uuser -ppass -h hostname
name tablename1 tablename2 ...
这样可以备份多个表的啊.
搜索此文相关文章:此文来自: 马开东博客
网址: 站长QQ
执行mysqldump的权限有关问题_PHP相关文章
PHP_总排行榜
PHP_月排行榜
PHP_周排行榜
PHP_日排行榜> 问题详情
体内dTMP合成的直接前体是(
悬赏:0&答案豆
提问人:匿名网友
发布时间:
体内dTMP合成的直接前体是(&&)&&A.TMP&&B.UMP&&C.dUMP&&D.UDP
我有更好的答案
论文写作技巧
相关考试课程
请先输入下方的验证码查看最佳答案
图形验证:
验证码提交中……《iOS应用逆向工程》学习笔记(六)使用dumpdecrypted砸壳 - 推酷
《iOS应用逆向工程》学习笔记(六)使用dumpdecrypted砸壳
本来是打算用AppCrackr砸壳的,结果砸壳都是失败的,开始以为是App的加密太厉害了,后来才知道是因为AppCrackr太暴力了,引起公愤,结果被人投诉招致核心功能被迫关闭了。
幸好在RE官网搜到一个
的帖子。下面是我砸壳的经历。
1.下载dumpdecrypted源码
下载地址:
,接着在Mac中解压。
2.确认iOS设备的版本&
iOS 7.1.x,原帖中snakeninny略啰嗦。。。&
3.Makefile&
cd到dumpdecrypted目录,看看Makefile文件的内容:
CC_BIN=`xcrun --sdk iphoneos --find gcc`
GCC_UNIVERSAL=$(GCC_BASE) -arch armv7 -arch armv7s -arch arm64
SDK=`xcrun --sdk iphoneos --show-sdk-path`
GCC_BASE = $(GCC_BIN) -Os $(CFLAGS) -Wimplicit -isysroot $(SDK) -F$(SDK)/System$
all: dumpdecrypted.dylib
dumpdecrypted.dylib: dumpdecrypted.o
$(GCC_UNIVERSAL) -dynamiclib -o $@ $^
$(GCC_UNIVERSAL) -c -o $@ $&
rm -f *.o dumpdecrypted.dylib
大多数看不懂。。。
接下来我们需要确认的是
GCC_UNIVERSAL
这两个变量的值和iOS设备的环境保持一致。
4.确保Makefile的配置和真机环境一致
在Mac中打开终端,输入
xcrun --sdk iphoneos --show-sdk-path
命令,查看SDK版本:
/Applications/Xcode 5.1.1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk
Xcode的SDK版本是7.1.x,GCC_UNIVERSAL这个变量值可以略过。
5.创建动态库文件
在确保Makefile中对动态库的设置和iOS真机环境一致后,在当前目录下输入:make。
但是失败了,错误信息如下:
`xcrun --sdk iphoneos --find gcc` -Os
-Wimplicit -isysroot `xcrun --sdk iphoneos --show-sdk-path` -F`xcrun --sdk iphoneos --show-sdk-path`/System/Library/Frameworks -F`xcrun --sdk iphoneos --show-sdk-path`/System/Library/PrivateFrameworks -arch armv7 -arch armv7s -arch arm64 -c -o dumpdecrypted.o dumpdecrypted.c
/bin/sh: /Applications/Xcode: No such file or directory
make: *** [dumpdecrypted.o] Error 127
原因是找不到/Applications/Xcode来执行其中的一些脚本。 好吧,我的Mac中有3个Xcode:/Applications/Xcode 5.0.2, /Applications/Xcode 5.1.1, /Applications/Xcode 6 Beta4,就是没有/Applications/Xcode。&
没事,将Xcode 5.1.1重命名为Xcode就行了:
$ sudo mv Xcode\ 5.1.1.app/ Xcode.app/
再make,还是报错,错误信息和上面一样。
不怕,我们还有xcode-select这个小伙伴,通常Xcode找不到之类的错误都应该找它帮忙:
$ xcode-select -p
/Applications/Xcode 5.1.1.app/Contents/Developer
原来xcrun查找cmd tool时的路径还是Xcode 5.1.1/,当然什么都找不到了。这时候将它重置就行了(默认是/Applications/Xcode.app/):
$ sudo xcode-select -r
$ xcode-select -p
/Applications/Xcode.app/Contents/Developer
再make,成功,输出如下:
`xcrun --sdk iphoneos --find gcc` -Os
-Wimplicit -isysroot `xcrun --sdk iphoneos --show-sdk-path` -F`xcrun --sdk iphoneos --show-sdk-path`/System/Library/Frameworks -F`xcrun --sdk iphoneos --show-sdk-path`/System/Library/PrivateFrameworks -arch armv7 -arch armv7s -arch arm64 -c -o dumpdecrypted.o dumpdecrypted.c
`xcrun --sdk iphoneos --find gcc` -Os
-Wimplicit -isysroot `xcrun --sdk iphoneos --show-sdk-path` -F`xcrun --sdk iphoneos --show-sdk-path`/System/Library/Frameworks -F`xcrun --sdk iphoneos --show-sdk-path`/System/Library/PrivateFrameworks -arch armv7 -arch armv7s -arch arm64 -dynamiclib -o dumpdecrypted.dylib dumpdecrypted.o
dumpdecrypted.c
dumpdecrypted.o
dumpdecrypted.dylib
可以看到目录中多了两个文件,其中dylib后缀的就是我们要创建的动态库文件,也就是用来砸壳的锤子。
1.将“锤子”放入设备中
查看iOS设备的IP地址,然后在Mac上使用scp命令将
dumpdecrypted.dylib
文件放到iOS设备中:
$ scp dumpdecrypted.dylib root@192.168.xxx.xxx:/var/tmp
root@192.168.xxx.xxx's password:
dumpdecrypted.dylib
选定一个让你觉得非常不爽或非常感兴趣的app,我就随便选了一个HBGC。在iOS设备上打开iFile,查到它的可执行文件的路径为:/var/mobile/Applications/EBBD26E9-DDBA-481E-436889/HBGC.app/HBGC
然后用SSH连到iOS设备上,cd到刚刚动态库的路径:/var/tmp。
$ ssh root@192.168.xxx.xxx
root@192.168.xxx.xxx's password:
root# cd /var/tmp/
FlipswitchCache/
com.apple.audio.hogmode.plist
L65ancd.sock=
com.apple.tccd/
L65d.sock=
com.apple.timed.plist
MediaCache/
RestoreFromBackupLock*
dumpdecrypted.dylib*
SpringBoard_reboot_flag
com.apple.assistant.bundleservicecache.plist
mobile_assertion_agent.log
砸壳(久等了):
root# DYLD_INSERT_LIBRARIES=dumpdecrypted.dylib /var/mobile/Applications/EBBD26E9-DDBA-481E-436889/HBGC.app/HBGC
mach-o decryption dumper
DISCLAIMER: This tool is only meant for security research purposes, not for application crackers.
[+] detected 32bit ARM binary in memory.
[+] offset to cryptid found: @0xd5a90(from 0xd5000) = a90
[+] Found encrypted data at address
of length 3047424 bytes - type 1.
[+] Opening /private/var/mobile/Applications/EBBD26E9-DDBA-481E-436889/HBGC.app/HBGC for reading.
[+] Reading header
[+] Detecting header type
[+] Executable is a FAT image - searching for right architecture
[+] Correct arch is at offset 16384 in the file
[+] Opening HBGC.decrypted for writing.
[+] Copying the not encrypted start of the file
[+] Dumping the decrypted data into the file
[+] Copying the not encrypted remainder of the file
[+] Setting the LC_ENCRYPTION_INFO-&cryptid to 0 at offset 4a90
[+] Closing original file
[+] Closing dump file
FlipswitchCache/
com.apple.audio.hogmode.plist
HBGC.decrypted
com.apple.tccd/
L65ancd.sock=
com.apple.timed.plist
L65d.sock=
MediaCache/
dumpdecrypted.dylib*
RestoreFromBackupLock*
SpringBoard_reboot_flag
mobile_assertion_agent.log
com.apple.assistant.bundleservicecache.plist
其中的HBGC.decrypted就是目标产物,接下来IDA各种斧头水果刀上吧。
首先简单看看xcrun的帮助信息:
$ xcrun -h
Usage: xcrun [options] &tool name& ... arguments ...
Find and execute the named command line tool from the active developer
directory.
The active developer directory can be set using `xcode-select`, or via the
DEVELOPER_DIR environment variable. See the xcrun and xcode-select manual
pages for more information.
-h, --help
show this help message and exit
show the xcrun version
-v, --verbose
show verbose logging output
--sdk &sdk name&
find the tool for the given SDK name
--toolchain &name&
find the tool for the given toolchain
show commands to be executed (with --run)
-f, --find
only find and print the tool path
find and execute the tool (the default behavior)
-n, --no-cache
do not use the lookup cache
-k, --kill-cache
invalidate all existing cache entries
--show-sdk-path
show selected SDK install path
--show-sdk-version
show selected SDK version
--show-sdk-platform-path
show selected SDK platform path
--show-sdk-platform-version show selected SDK platform version
xcrun的作用在于从一个激活的开发者目录(active developer directory)中查找一个command line tool,并执行这个工具。&
例如上面的Makefile中: GCC_BIN=`xcrun --sdk iphoneos --find gcc`&
分解来看:&
(1)xcrun --find gcc
$ xcrun --find gcc
/Applications/Xcode 5.1.1.app/Contents/Developer/usr/bin/gcc
这一步获取了gcc这个tool的路径,设为cmd_tool_path。&
(2)xcrun --sdk iphoneos cmd_tool_path&
这一步通过路径名获取到了具体的工具程序,这个工具对应iphoneos的SDK,并执行该工具。&
(3)GCC_BIN是一条shell命令,对应的就是这个查找和执行工具的过程。&
再如: xcrun --sdk iphoneos --show-sdk-path&
它的作用就是查找对应于iphoneos SDK的SDK并执行。
$ xcrun --show-sdk-path
/Applications/Xcode 5.1.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk
$ xcrun --sdk iphoneos --show-sdk-path
/Applications/Xcode 5.1.1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk
2.xcode-select
首先看看简单的帮助信息:
$ xcode-select -h
Usage: xcode-select [options]
Print or change the path to the active developer directory. This directory
controls which tools are used for the Xcode command line tools (for example,
xcodebuild) as well as the BSD development commands (such as cc and make).
-h, --help
print this help message and exit
-p, --print-path
print the path of the active developer directory
-s &path&, --switch &path&
set the path for the active developer directory
-v, --version
print the xcode-select version
-r, --reset
reset to the default command line tools path
它的作用在于打印或改变active developer directory,而
xcrun就是从这个directory中查找对应的工具
。 通常它的值为:
/Applications/Xcode 5.1.1.app/Contents/Developer
例如,在/Applications/Xcode 5.1.1.app/Contents/Developer/usr/bin中,可以看到一些上文需要的gcc:
BuildStrings
projectInfo
GetFileInfo
git-cvsserver
resolveLinks
ImageUnitAnalyzer
git-receive-pack
git-upload-archive
git-upload-pack
hdxml2manxml
svndumpfilter
headerdoc2html
SplitForks
TextureAtlas
svnversion
instruments
xcodebuild
以上只是部分输出。
注:以上是我个人在自己的机子上的砸壳经历,大家要根据自己的实际情况进行,详细请参考:
已发表评论数()
请填写推刊名
描述不能大于100个字符!
权限设置: 公开
仅自己可见
正文不准确
标题不准确
排版有问题
主题不准确
没有分页内容
图片无法显示
视频无法显示
与原文不一致博客访问: 578875
博文数量: 256
博客积分: 1242
博客等级: 少尉
技术积分: 1406
注册时间:
IT168企业级官微
微信号:IT168qiye
系统架构师大会
微信号:SACC2013
分类: LINUX
什么是coredump?
通常情况下coredmp包含了程序运行时的内存,寄存器状态,堆栈指针,内存管理信息等。可以理解为把程序工作的当前状态存储成一个文件。许多程序和操作系统出错时会自动生成一个core文件。
如何使用coredump?
coredump可以用在很多场合,使用Linux,或者solaris的人可能都有过这种经历,系统在跑一些压力测试或者系统负载一大的话,系统就hang住了或者干脆system panic.这时唯一能帮助你分析和解决问题的就是coredump了。
现在很多应该程序出错时也会出现coredump.
分析coredump的工具
现在大部分类unix操作系统都提供了分析core文件的工具,比如 GNU Binutils Binary File Descriptor library (BFD), GNU Debugger (gdb),mdb等
coredump的文件格式
类unix操作系统中使用efi格式保存coredump文件。
在solairs下
bash-3.2# file *unix.3 ELF 32-bit LSB executable 80386 Version 1, statically linked, not stripped, no debugging information availableunix.4 ELF 32-bit LSB executable 80386 Version 1, statically linked, not stripped, no debugging information available
造成程序coredump的原因很多,这里根据以往的经验总结一下:
1 内存访问越界& a) 由于使用错误的下标,导致数组访问越界& b) 搜索字符串时,依靠字符串结束符来判断字符串是否结束,但是字符串没有正常的使用结束符& c) 使用strcpy, strcat, sprintf, strcmp, strcasecmp等字符串操作函数,将目标字符串读/写爆。应该使用strncpy, strlcpy, strncat, strlcat, snprintf, strncmp, strncasecmp等函数防止读写越界。&2 多线程程序使用了线程不安全的函数。应该使用下面这些可重入的函数,尤其注意红色标示出来的函数,它们很容易被用错:asctime_r(3c) gethostbyname_r(3n) getservbyname_r(3n) ctermid_r(3s) gethostent_r(3n) getservbyport_r(3n) ctime_r(3c) getlogin_r(3c) getservent_r(3n) fgetgrent_r(3c) getnetbyaddr_r(3n) getspent_r(3c) fgetpwent_r(3c) getnetbyname_r(3n) getspnam_r(3c) fgetspent_r(3c) getnetent_r(3n) gmtime_r(3c) gamma_r(3m) getnetgrent_r(3n) lgamma_r(3m) getauclassent_r(3) getprotobyname_r(3n) localtime_r(3c) getauclassnam_r(3) etprotobynumber_r(3n) nis_sperror_r(3n) getauevent_r(3) getprotoent_r(3n) rand_r(3c) getauevnam_r(3) getpwent_r(3c) readdir_r(3c) getauevnum_r(3) getpwnam_r(3c) strtok_r(3c) getgrent_r(3c) getpwuid_r(3c) tmpnam_r(3s) getgrgid_r(3c) getrpcbyname_r(3n) ttyname_r(3c) getgrnam_r(3c) getrpcbynumber_r(3n) gethostbyaddr_r(3n) getrpcent_r(3n)&3 多线程读写的数据未加锁保护。对于会被多个线程同时访问的全局数据,应该注意加锁保护,否则很容易造成core dump&4 非法指针& a) 使用空指针& b) 随意使用指针转换。一个指向一段内存的指针,除非确定这段内存原先就分配为某种结构或类型,或者这种结构或类型的数组,否则不要将它转换为这种结构或类型 的指针,而应该将这段内存拷贝到一个这种结构或类型中,再访问这个结构或类型。这是因为如果这段内存的开始地址不是按照这种结构或类型对齐的,那么访问它 时就很容易因为bus error而core dump.&5 堆栈溢出不要使用大的局部变量(因为局部变量都分配在栈上),这样容易造成堆栈溢出,破坏系统的栈和堆结构,导致出现莫名其妙的错误。
coredump文件的生成方法以及使用方法:
(假设下例是在上交叉编译,而在上运行异常的现象)
在内核里加入的支持(一般内核都支持 不用重编)
运行命令,此时允许文件产生:在上&ulimit –c unlimited
执行程序:(在上)在异常退出时,会显示如下信息,注意括号里的内容Segmentation fault (core dumped)程序执行目录下将产生文件
用分析:(在上)再用的或看就可以了的编译见调试工具之四
系统支持生成core并设置存储位置的方法:
1> 在/etc/profile中加入以下一行,这将允许生成coredump文件ulimit -c unlimited2> 在rc.local中加入以下一行,这将使程序崩溃时生成的coredump文件位于/tmp目录下:echo /tmp/core.%e.%p > /proc/sys/kernel/core_pattern& /tmp/也可以是其它的目录位置。最佳位置应当满足以下需求:* 对所有用户可写* 空间容量足够大* 掉电后文件不丢失
阅读(2226) | 评论(0) | 转发(0) |
相关热门文章
给主人留下些什么吧!~~
请登录后评论。

我要回帖

更多关于 生物醇油连体灶头厂家 的文章

 

随机推荐