본문 바로가기
조회 수 1048 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

+ - Up Down Comment Print
?

단축키

Prev이전 문서

Next다음 문서

+ - Up Down Comment Print

Convert ascii to hex and vice versa (hexdump, od, xxd, echo -e)


########################

# Convert ascii to hex

########################


Using hexdump


$ echo 'welcome' | hexdump 

0000000 77 65 6c 63 6f 6d 65 0a  <-------- little endian format                       

0000008


$ echo 'welcome' | hexdump -C

00000000  77 65 6c 63 6f 6d 65 0a                           |welcome.|

00000008


$ echo 'welcome' | hexdump -c

0000000   w   e   l   c   o   m   e  \n                                

0000008


Using od


$ echo 'welcome' | od -x 

0000000      6577    636c    6d6f    0a65   <----- big endian format                             

0000010


$ echo 'welcome' | od -xc

0000000      6577    636c    6d6f    0a65                                

           w   e   l   c   o   m   e  \n                                

0000010


Using xxd


$ echo 'welcome' | xxd

0000000: 7765 6c63 6f6d 650a                      welcome.


$ echo 'welcome' | xxd > test

$ xxd -r test

welcome


########################

# Convert hex to ascii

########################


$ echo -e "\x68\x74t\x70\x3a\x2f\x2f"

http://


###########################

# Read file with hexdump

###########################


$ hexdump test.png

0000000 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52

0000010 00 00 02 e8 00 00 02 70 08 06 00 00 00 db 6f 94

0000020 be 00 00 0a 41 69 43 43 50 49 43 43 20 50 72 6f

[...]


$ hexdump -C test.png

00000000  89 50 4e 47 0d 0a 1a 0a  00 00 00 0d 49 48 44 52  |.PNG........IHDR|

00000010  00 00 02 e8 00 00 02 70  08 06 00 00 00 db 6f 94  |.......p......o.|

00000020  be 00 00 0a 41 69 43 43  50 49 43 43 20 50 72 6f  |....AiCCPICC Pro|

[...]



Title
List of Articles
번호 제목 글쓴이 날짜 조회 수
20 How to Decrypt SSL and TLS Traffic using Wireshark (test with sample file) file Hojung 2015.01.23 2424
19 자바스크립트 난독화 기법 / 분석 방법론 (정리예정) Hojung 2015.01.05 1451
18 Base64 encode/decode with OpenSSL Hojung 2015.01.04 1327
» Convert ascii to hex and vice versa (hexdump, od, xxd, echo -e) Hojung 2015.01.04 1048
16 Simple ruby script to de-obfuscate with XOR string Hojung 2015.01.01 681
15 Installing yara on CentOS and test with Ruby script Hojung 2014.12.31 1964
14 Installing Yara for ruby on Mac Hojung 2014.12.31 734
13 How to find the original email sender (check X-Originating-IP or Received headers) Hojung 2014.12.29 850
12 Links for FireEye Deployment Check Hojung 2014.12.11 2562
11 Get timezone info from system logs which is /var/log/messages Hojung 2014.12.07 761
10 Analysing NTPd logs file Hojung 2014.12.07 1443
9 Sguil with tcpreplay (Security Onion) file Hojung 2014.12.01 2281
8 Wireshark settings for traffic analysis file Hojung 2014.11.29 1071
7 Security Onion with Snort and Snorby (pulledpork and snort with offline pcap included) file Hojung 2014.11.24 3581
6 Snort on Ubuntu 14 (Barnyard2, PulledPork, BASE, Snort with pcap) file Hojung 2014.11.22 3271
5 How to install Snorby in Kali (snort) file Hojung 2014.11.21 9438
4 install geoiplookup on Mac Hojung 2014.08.06 2882
3 DDoS 공격대응 가이드 Hojung 2014.07.29 4006
2 DDoS 분석도구 설치 및 분석 (tcpdstat, ngrep, httpry) Hojung 2014.07.25 3404
1 Perl script to push samples to Virustotal Hojung 2014.02.20 1244
Board Pagination ‹ Prev 1 Next ›
/ 1

Designed by sketchbooks.co.kr / sketchbook5 board skin

나눔글꼴 설치 안내


이 PC에는 나눔글꼴이 설치되어 있지 않습니다.

이 사이트를 나눔글꼴로 보기 위해서는
나눔글꼴을 설치해야 합니다.

설치 취소

Sketchbook5, 스케치북5

Sketchbook5, 스케치북5

Sketchbook5, 스케치북5

Sketchbook5, 스케치북5