Wednesday, May 31, 2023

Pointers Part 1: The Basics



So you're eager to learn about pointers but unfortunately you got stuck because they seemed to you terrible in nature? That's not true I know, but many of the people get confused when they arrive at the topic of pointers. Well pointers are the most important tools in C programming and are the one that can make you fly (unless you don't know how to ride over them). In this article we're going to learn basics of pointers.
Pointers are the varaibles that store addresses of other variables. Easy ain't it?
So lets start with the decleration of a pointer, pointer is decreleared as:
data_type *var_name;
e,g
int *pt;
well the astrisk(*) before the variable name is the thing that makes variable a pointer. So far so good now what?
Now lets say we want to store address of a variable in our pointer variable that seems pretty complex..!
Let's do it:
int number = 100;
int *pt = #
Is it really complex..?
what we are doing here is that we are first declaring and initializing a integer variable (number) with value of 100 and then we declare and initialize a pointer variable (pt) with the address of number variable. Now pt (pointer variable) contains the address of number (integer varaible). So what? Now we can use this pointer variable to change the value of number variable. Is this some kind of Magic? Maybe. Lets' do it:
*pt = 200;
what we have done here is that we De-referencing the pt variable with the asterisk (*) and then assigned it the value of 200 now the number variable contains 200. Isn't it a magic? De-referencing is used for accessing the value of the variable towards which our pointer is pointing simple. So lets write a full program of what we have learned so far.
/*Pointer Basics: Creating and Using Pointers*/
#include<stdio.h>
int main(void){
  int number = 100;
  int *pt = &number;
  printf("Value of 'number' is: %d", number);
  printf("Address of 'number' is: %p", pt);
  *pt = 200;
  printf("New value of 'number' is: %d", number);
  return 0;
}
What this whole program did was it created a integer variable and a pointer to integer variable and then printed out the value and address of the 'number' variable and after that we De-referenced the pointer variable so that we can access the value to which our pointer variable is pointing and changed the old 100 value with new 200 value and at last we printed that out. Easy isn't it?
But do you know that you can get the address of a variable even by using ampersand (&) operator? Lemme show you how. I'll declare and initialize a variable 'var' and then print it to screen using ampersand (&) operator:
int var = 10;
printf("Address of 'var' is %p\n", &var);
the last statement here will print out the address of 'var' not value so that means it is equal to this statement:
int *pt = &var;
printf("Address of 'var' is %p\n", pt);
here we first assigned the address of 'var' to pointer variable 'pt' and then printed out the address of 'var' using the pointer variable (pt).
So lets write another program that will wrap up this part of 'Pointer Basics':
/*Pointer Basics Part 1: Program 2*/
#include<stdio.h>
int main(void){
   int var = 10;
   int *pt = &var;
   printf("The Value of 'var' is: %d\n", var);
   printf("De-referencing: *pt = %d\n", *pt);
   printf("Ampersand: The Address of 'var' is %p\n",  &var);
   printf("pt = %p\n", pt);
   return 0;
}
So that's the end of first part watch out for the next part in which we'll tighten our grip on pointers and get ready for some Advanced '*po(inter)-fo'.
Related posts

ANNOUNCEMENT: Submitters Of Papers And Training For Global AppSec DC 2019 (Formerly AppSec USA)

We had an overwhelming turnout out of submissions for Call for Papers and Call for Training for the OWASP Global AppSec DC 2019 (formerly AppSec USA)  We want to give each submission the time deserved to evaluate each before choosing.  Keeping that in mind the notifications of acceptance and thanks will be CHANGED to July 1, 2019.  We appreciate your understanding and patience in this matter.

Related posts


  1. Hack Tool Apk No Root
  2. Termux Hacking Tools 2019
  3. Hacker Tools For Mac
  4. Hacker Security Tools
  5. Hak5 Tools
  6. Tools For Hacker
  7. Hacker Tools For Ios
  8. Pentest Tools For Ubuntu
  9. Pentest Tools Framework
  10. Pentest Recon Tools
  11. How To Install Pentest Tools In Ubuntu
  12. Hack Tools For Pc
  13. Hacking Tools For Pc
  14. Hacker Security Tools
  15. Termux Hacking Tools 2019
  16. Hack Tool Apk
  17. Hack Tools Pc
  18. Hacking Tools For Windows
  19. Pentest Recon Tools
  20. Pentest Tools Port Scanner
  21. Hacker Tools Apk
  22. Hacking Tools Usb
  23. New Hack Tools
  24. Pentest Tools Subdomain
  25. Github Hacking Tools
  26. Pentest Tools Port Scanner
  27. Pentest Tools Download
  28. Hacker
  29. Hack Tools For Pc
  30. Hack Tools
  31. Hacker
  32. Usb Pentest Tools
  33. Hacker Tools Hardware
  34. Usb Pentest Tools
  35. Hacking Tools Windows
  36. Hacking Tools Download
  37. Top Pentest Tools
  38. Hacking Tools Kit
  39. Pentest Tools Windows
  40. Hacking Tools Mac
  41. Pentest Tools Online
  42. Hack App
  43. Hacker Tool Kit
  44. Hack Tools For Windows
  45. Hacker Tool Kit
  46. Hacker Techniques Tools And Incident Handling
  47. Hack Tool Apk No Root
  48. Pentest Recon Tools
  49. Hack Tools Download
  50. Hack Tools
  51. Hacker Tool Kit
  52. Wifi Hacker Tools For Windows
  53. Best Hacking Tools 2019
  54. Hack And Tools
  55. Hack Tools Online
  56. Hacking Tools Name
  57. Best Hacking Tools 2020
  58. Hacking Apps
  59. Hacking Tools
  60. Hackrf Tools
  61. Hacks And Tools
  62. Hackers Toolbox
  63. What Is Hacking Tools
  64. Bluetooth Hacking Tools Kali
  65. Hack Tools
  66. Best Hacking Tools 2019
  67. Hacking Tools Windows
  68. Hack Tool Apk
  69. Hacking Tools Online
  70. Hacking Tools For Pc
  71. Hack Tools Mac
  72. Pentest Tools Open Source
  73. Tools Used For Hacking
  74. Easy Hack Tools
  75. Hacker Tools Linux
  76. Hacking App
  77. Pentest Tools Bluekeep
  78. Hack Tools Mac
  79. Hack Tools Mac
  80. Hacker Tools 2019
  81. Pentest Tools Github
  82. Pentest Tools For Windows
  83. Pentest Tools Apk
  84. What Is Hacking Tools
  85. Hack Tools
  86. Physical Pentest Tools
  87. Hack Tools For Windows
  88. Top Pentest Tools
  89. How To Install Pentest Tools In Ubuntu
  90. Tools 4 Hack
  91. Pentest Tools Bluekeep
  92. Hack Tools
  93. Hack Tools Mac
  94. Hacking Tools For Games
  95. Hacking Tools For Beginners
  96. Hack Website Online Tool
  97. Hack Tools For Ubuntu
  98. Pentest Tools List
  99. Hack And Tools
  100. Blackhat Hacker Tools
  101. Hacker Security Tools
  102. New Hacker Tools
  103. Pentest Tools Alternative
  104. Hacker Tool Kit
  105. What Are Hacking Tools
  106. Hacker Tools Mac
  107. Hack Tool Apk No Root
  108. Hacker Tools 2019
  109. Hack Tool Apk
  110. Hacker Tool Kit
  111. Hacker Tools Apk
  112. Hackrf Tools
  113. Kik Hack Tools
  114. Hacking Tools Hardware
  115. Hack App
  116. Pentest Tools Apk
  117. Hacker Tools For Mac
  118. Hacking Tools For Pc
  119. How To Hack
  120. Hacking Tools For Beginners
  121. Pentest Tools Framework
  122. Hacker Tools For Pc
  123. Hacker Tools For Pc
  124. Nsa Hack Tools
  125. Nsa Hack Tools Download
  126. Black Hat Hacker Tools
  127. Pentest Tools For Android
  128. World No 1 Hacker Software
  129. Growth Hacker Tools
  130. Free Pentest Tools For Windows
  131. Hacker Tools For Mac

Tuesday, May 30, 2023

Hacking All The Cars - Part 2


Connecting Hardware to Your Real Car: 

 I realized the other day I posted Part 2 of this series to my youtube awhile ago but not blogger so this one will be quick and mostly via video walkthrough. I often post random followup videos which may never arrive on this blog. So if you're waiting on something specific I mentioned or the next part to a series its always a good idea to subscribe to the YouTube. This is almost always true if there is video associated with the post.  

In the last blog we went over using virtual CAN devices to interact with a virtual car simulators of a CAN network This was awesome because it allowed us to learn how to interact with he underlying CAN network without fear of hacking around on an expensive automobile. But now it's time to put on your big boy pants and create a real CAN interface with hardware and plug your hardware device into your ODB2 port. 

The video I created below will show you where to plug your device in, how to configure it and how to take the information you learned while hacking around on the virtual car from part1 and apply it directly to a real car.   

Video Walk Through Using Hardware on a Real Car




As a reference here are the two device options I used in the video and the needed cable: 

Hardware Used: 

Get OBD2 Cable:
https://amzn.to/2QSmtyL

Get CANtact:
https://amzn.to/2xCqhMt

Get USB2CAN:
https://shop.8devices.com/usb2can


Creating Network Interfaces: 

As a reference here are the commands from the video for creating a CAN network interface: 

USB2Can Setup: 
The following command will bring up your can interface and you should see the device light color change: 
sudo ip link set can0 up type can bitrate 125000

Contact Setup: 
Set your jumpers on 3,5 and 7 as seen in the picture in the video
Sudo slcand -o -s6 /dev/ttyACM can0 <— whatever device you see in your DMESG output
Ifconfig can0 up

Summary: 

That should get you started connecting to physical cars and hacking around. I was also doing a bit of python coding over these interfaces to perform actions and sniff traffic. I might post that if anyone is interested. Mostly I have been hacking around on blockchain stuff and creating full course content recently so keep a look out for that in the future. 

Related posts

  1. Usb Pentest Tools
  2. Pentest Automation Tools
  3. Hacker Tools For Pc
  4. Pentest Automation Tools
  5. Hackers Toolbox
  6. Nsa Hack Tools Download
  7. Computer Hacker
  8. Pentest Tools Tcp Port Scanner
  9. Hacking Tools Hardware
  10. Best Pentesting Tools 2018
  11. Hack Apps
  12. New Hack Tools
  13. Pentest Tools Subdomain
  14. Pentest Tools Open Source
  15. Pentest Tools Linux
  16. Hacker Tools 2020
  17. Hak5 Tools
  18. Free Pentest Tools For Windows
  19. Pentest Tools For Windows
  20. Hacker Search Tools
  21. Best Hacking Tools 2019
  22. Pentest Tools Online
  23. Hack Tools For Pc
  24. Termux Hacking Tools 2019
  25. Nsa Hacker Tools
  26. Easy Hack Tools
  27. Hacker Tools For Mac
  28. Hacker Search Tools
  29. Bluetooth Hacking Tools Kali
  30. Hack Tool Apk
  31. Hacking Tools Hardware
  32. Pentest Tools Download
  33. Hacking Tools Free Download
  34. Easy Hack Tools
  35. Hacking Tools
  36. Hacking Tools Free Download
  37. Hacking Tools Usb
  38. Hack Tools For Windows
  39. Hack Tools For Pc
  40. Hacker Tools Github
  41. Hacking Apps
  42. Hacking Tools Usb
  43. Hack Tools
  44. Pentest Tools Linux
  45. Pentest Tools Url Fuzzer
  46. What Is Hacking Tools
  47. Pentest Tools Kali Linux
  48. Hacking Tools Name
  49. Hacker Tools Apk Download
  50. Easy Hack Tools
  51. Hacking Tools And Software
  52. Hacker Tools For Mac
  53. Hacking Tools Download
  54. Hack Tool Apk No Root
  55. Pentest Tools Apk
  56. Hacker Tools
  57. Top Pentest Tools
  58. Growth Hacker Tools
  59. Android Hack Tools Github
  60. Pentest Tools Windows
  61. Hacker Search Tools
  62. Pentest Box Tools Download
  63. Hacker Tool Kit
  64. Hack Rom Tools
  65. Hack Tools Online
  66. Pentest Tools For Windows
  67. Pentest Tools Linux
  68. Hacking Tools Usb
  69. Hack Tools Github
  70. Hacking Tools For Windows
  71. Hacker Tools List
  72. Hacking Tools For Kali Linux
  73. Pentest Tools For Mac
  74. Hacking App
  75. Pentest Tools List
  76. Blackhat Hacker Tools
  77. Best Hacking Tools 2019
  78. Hacking Tools Mac
  79. Best Hacking Tools 2020
  80. Hacking Tools Mac
  81. Hack Tools Download
  82. How To Make Hacking Tools
  83. Hacker Tools For Ios
  84. Hacking Tools Name
  85. Best Hacking Tools 2019
  86. Top Pentest Tools
  87. Hack Tools Mac
  88. Underground Hacker Sites
  89. Hacking Tools For Windows
  90. Pentest Tools Windows
  91. Computer Hacker
  92. Pentest Tools Alternative
  93. Hacker Tools
  94. Free Pentest Tools For Windows
  95. Hacker Tools List
  96. Hacking App
  97. Hak5 Tools
  98. Hacker Tools For Mac
  99. Hacking Tools For Games
  100. Install Pentest Tools Ubuntu
  101. Top Pentest Tools
  102. Pentest Tools Kali Linux
  103. What Are Hacking Tools
  104. Bluetooth Hacking Tools Kali
  105. Hacker Tools Apk Download
  106. Hacking Tools Windows
  107. Hacker Tools 2019
  108. Hack Apps
  109. Hacker Tools Github
  110. Hacking Tools Windows 10
  111. Hack Rom Tools
  112. Hacking Tools For Windows 7
  113. Game Hacking
  114. Hacker Tools Mac
  115. Hacker Tools Apk
  116. Ethical Hacker Tools
  117. Hack Tools For Pc
  118. Hacker Tools 2020
  119. How To Hack
  120. Hackrf Tools
  121. Hacking Tools Github
  122. Pentest Tools Alternative
  123. Hacker Tools Github
  124. Hacking Tools Name
  125. Hacking Tools Download
  126. Hacking Tools Online
  127. Hack Tools Online
  128. Game Hacking
  129. Hacker Tools Apk Download
  130. Pentest Reporting Tools
  131. Pentest Tools Nmap
  132. Pentest Tools Port Scanner
  133. Kik Hack Tools
  134. Hack Apps
  135. Hacker Tools 2019
  136. Pentest Tools Nmap
  137. Hack Rom Tools
  138. Hacking Tools For Games
  139. Hacker Tools For Ios
  140. Hacking Tools For Beginners
  141. Hacker Tools Free Download
  142. Hacker Tools Windows
  143. Hacking Tools Github
  144. How To Make Hacking Tools
  145. Hack Tools Mac
  146. Physical Pentest Tools
  147. Install Pentest Tools Ubuntu
  148. How To Hack
  149. Pentest Tools Tcp Port Scanner
  150. Hacker
  151. Hack Tools Mac
  152. Easy Hack Tools
  153. Pentest Tools Alternative
  154. Pentest Tools List
  155. Hacker Tools 2019
  156. Hacker Tools Linux
  157. Hacker Tools Online
  158. Hacker Search Tools
  159. Pentest Tools Android
  160. Wifi Hacker Tools For Windows
  161. Hacking Tools Online
  162. Best Hacking Tools 2020
  163. Pentest Tools Free
  164. Hacking Tools Pc
  165. Android Hack Tools Github
  166. Hacker Tools List
  167. Hacking Tools Windows
  168. Hacker Security Tools
  169. Hacking Tools Name
  170. Hacking Tools
  171. Hack Tool Apk No Root
  172. Hacking Tools For Windows Free Download
  173. Hack Tools Download